From 2bc1eee14394d1c277b2dfc3a68e591c4bef66a9 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Tue, 2 Jul 2024 18:21:24 +0200 Subject: Improved recursive.lua --- tests/recursive.lua | 10 +++++----- 1 file 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 @@ -- Test program for Lua Lanes -- -io.stderr:write( "depth:" ) +io.stderr:write("depth: ") local function func( depth ) - io.stderr:write(" " .. depth) - if depth > 10 then + io.stderr:write(depth .. " ") + if depth <= 0 then return "done!" end local lanes = require "lanes" - local lane = lanes.gen("*", func)( depth+1 ) + local lane = lanes.gen("*", func)( depth-1 ) return lane[1] end -local v= func(0) +local v= func(100) assert(v=="done!") io.stderr:write("TEST OK\n") -- cgit v1.2.3-55-g6feb