aboutsummaryrefslogtreecommitdiff
path: root/tests/recursive.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/recursive.lua')
-rw-r--r--tests/recursive.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/recursive.lua b/tests/recursive.lua
new file mode 100644
index 0000000..49c03d3
--- /dev/null
+++ b/tests/recursive.lua
@@ -0,0 +1,21 @@
1--
2-- RECURSIVE.LUA
3--
4-- Test program for Lua Lanes
5--
6
7io.stderr:write( "depth:" )
8local function func( depth )
9 io.stderr:write(" " .. depth)
10 if depth > 10 then
11 return "done!"
12 end
13
14 require "lanes"
15 local lane= lanes.gen("*", func)( depth+1 )
16 return lane[1]
17end
18
19local v= func(0)
20assert(v=="done!")
21io.stderr:write("\n")