diff options
Diffstat (limited to 'tests/func_is_string.lua')
-rw-r--r-- | tests/func_is_string.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/func_is_string.lua b/tests/func_is_string.lua index 5de4c60..3c91603 100644 --- a/tests/func_is_string.lua +++ b/tests/func_is_string.lua | |||
@@ -21,16 +21,17 @@ end | |||
21 | 21 | ||
22 | local options = {globals = { b = 666 }} | 22 | local options = {globals = { b = 666 }} |
23 | 23 | ||
24 | local gen1 = lanes.gen("*", { name = 'auto' }, "return true, dofile('fibonacci.lua')") | 24 | local gen1 = lanes.gen("*", { name = 'auto' }, "return true, error('bob')") |
25 | local gen2 = lanes.gen(options, { name = 'auto' }, "return b") | ||
26 | 25 | ||
27 | fibLane = gen1() | 26 | fibLane = gen1() |
28 | lanes.sleep(0.1) | 27 | lanes.sleep(0.1) |
29 | print(fibLane, fibLane.status) | 28 | print(fibLane, fibLane.status) |
30 | local _status, _err = fibLane:join() | 29 | local _r, _err, _stk = fibLane:join() |
31 | print(_status, _err) | 30 | assert(_r == nil, "got " .. tostring(_r) .. " " .. tostring(_err) .. " " .. tostring(_stk)) |
32 | 31 | ||
33 | retLane1, retLane2 = gen2(), gen2() | 32 | local gen2 = lanes.gen(options, { name = 'auto' }, "return b") |
33 | local retLane1, retLane2 = gen2(), gen2() | ||
34 | 34 | ||
35 | print( retLane1[1], retLane2[1]) | 35 | print( retLane1[1], retLane2[1]) |
36 | print "TEST OK" \ No newline at end of file | 36 | assert(retLane1[1] == 666 and retLane2[1] == 666) |
37 | print "TEST OK" | ||