aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2021-06-28 08:50:19 +0200
committerBenoit Germain <bnt.germain@gmail.com>2021-06-28 08:50:19 +0200
commitcce1a1d235322cf51d62305aee89c7bfa64e9905 (patch)
tree10bb1071d27c4e675bd96d842ddfb0c84284a403
parent909470be9f7ec1dd2d09ae1a371d69c9c652e957 (diff)
downloadlanes-cce1a1d235322cf51d62305aee89c7bfa64e9905.tar.gz
lanes-cce1a1d235322cf51d62305aee89c7bfa64e9905.tar.bz2
lanes-cce1a1d235322cf51d62305aee89c7bfa64e9905.zip
fixed some tests
-rw-r--r--tests/ehynes.lua2
-rw-r--r--tests/finalizer.lua4
-rw-r--r--tests/require.lua4
3 files changed, 6 insertions, 4 deletions
diff --git a/tests/ehynes.lua b/tests/ehynes.lua
index 7609ddd..e203a12 100644
--- a/tests/ehynes.lua
+++ b/tests/ehynes.lua
@@ -36,7 +36,7 @@ local receiver2 = receiver_gen('another message')
36 36
37-- a function to pause and log the execution for debugging 37-- a function to pause and log the execution for debugging
38local function logf(s, f, ...) 38local function logf(s, f, ...)
39 os.execute('sleep 1') 39 linda:receive(1, "dummy") -- wait 1s
40 PRINT_FMT( "*** %s", s ) 40 PRINT_FMT( "*** %s", s )
41 f(...) 41 f(...)
42end 42end
diff --git a/tests/finalizer.lua b/tests/finalizer.lua
index dc9ed34..0dc51a6 100644
--- a/tests/finalizer.lua
+++ b/tests/finalizer.lua
@@ -28,7 +28,9 @@ local function lane()
28 28
29 f:write( "Test file that should get removed." ) 29 f:write( "Test file that should get removed." )
30 30
31 io.stderr:write( "File "..FN.." created\n" ) 31 io.stderr:write( "File "..FN.." created\n" )
32 -- don't forget to close the file immediately, else we won't be able to delete it until f is collected
33 f:close()
32 34
33 if which==0 then 35 if which==0 then
34 print "you loose" 36 print "you loose"
diff --git a/tests/require.lua b/tests/require.lua
index 656a7dd..1730ce4 100644
--- a/tests/require.lua
+++ b/tests/require.lua
@@ -7,7 +7,7 @@ lanes = require "lanes"
7lanes.configure{with_timers = false} 7lanes.configure{with_timers = false}
8 8
9local function a_lane() 9local function a_lane()
10 print "IN A LANE" 10 print "IN A LANE"
11 -- To require 'math' we still actually need to have it initialized for 11 -- To require 'math' we still actually need to have it initialized for
12 -- the lane. 12 -- the lane.
13 -- 13 --
@@ -16,7 +16,7 @@ local function a_lane()
16 assert( math.sqrt(4)==2 ) 16 assert( math.sqrt(4)==2 )
17 17
18 assert( lanes==nil ) 18 assert( lanes==nil )
19 local lanes = require "lanes".configure{with_timers = false} 19 local lanes = require "lanes"
20 assert( lanes and lanes.gen ) 20 assert( lanes and lanes.gen )
21 21
22 local h= lanes.gen( function() return 42 end ) () 22 local h= lanes.gen( function() return 42 end ) ()