diff options
-rw-r--r-- | tests/recursive.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/recursive.lua b/tests/recursive.lua index 97b9c5b..716fe60 100644 --- a/tests/recursive.lua +++ b/tests/recursive.lua | |||
@@ -4,18 +4,18 @@ | |||
4 | -- Test program for Lua Lanes | 4 | -- Test program for Lua Lanes |
5 | -- | 5 | -- |
6 | 6 | ||
7 | io.stderr:write( "depth:" ) | 7 | io.stderr:write("depth: ") |
8 | local function func( depth ) | 8 | local function func( depth ) |
9 | io.stderr:write(" " .. depth) | 9 | io.stderr:write(depth .. " ") |
10 | if depth > 10 then | 10 | if depth <= 0 then |
11 | return "done!" | 11 | return "done!" |
12 | end | 12 | end |
13 | 13 | ||
14 | local lanes = require "lanes" | 14 | local lanes = require "lanes" |
15 | local lane = lanes.gen("*", func)( depth+1 ) | 15 | local lane = lanes.gen("*", func)( depth-1 ) |
16 | return lane[1] | 16 | return lane[1] |
17 | end | 17 | end |
18 | 18 | ||
19 | local v= func(0) | 19 | local v= func(100) |
20 | assert(v=="done!") | 20 | assert(v=="done!") |
21 | io.stderr:write("TEST OK\n") | 21 | io.stderr:write("TEST OK\n") |