aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-07-02 18:21:24 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-07-02 18:21:24 +0200
commit2bc1eee14394d1c277b2dfc3a68e591c4bef66a9 (patch)
treed9f3f6acc9135732b4a5eb54f7abe9fba258f346 /tests
parent4536b4d5f94fc7d94f0c613780ca6a09e00edccd (diff)
downloadlanes-2bc1eee14394d1c277b2dfc3a68e591c4bef66a9.tar.gz
lanes-2bc1eee14394d1c277b2dfc3a68e591c4bef66a9.tar.bz2
lanes-2bc1eee14394d1c277b2dfc3a68e591c4bef66a9.zip
Improved recursive.lua
Diffstat (limited to 'tests')
-rw-r--r--tests/recursive.lua10
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
7io.stderr:write( "depth:" ) 7io.stderr:write("depth: ")
8local function func( depth ) 8local 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]
17end 17end
18 18
19local v= func(0) 19local v= func(100)
20assert(v=="done!") 20assert(v=="done!")
21io.stderr:write("TEST OK\n") 21io.stderr:write("TEST OK\n")