aboutsummaryrefslogtreecommitdiff
path: root/tests/rupval.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/rupval.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/rupval.lua b/tests/rupval.lua
index 7b5a270..1079168 100644
--- a/tests/rupval.lua
+++ b/tests/rupval.lua
@@ -2,24 +2,29 @@ lanes = require "lanes".configure{with_timers=false}
2 2
3-- make sure we can copy functions with interdependant upvalues 3-- make sure we can copy functions with interdependant upvalues
4 4
5local x = 33
6local y = 44
7local z = 55
8
5local b 9local b
6local a = function( n) 10local a = function( n)
7 print( "a", n) 11 print( "a", n)
8 return n <= 0 and n or b( n-1) 12 return n <= 0 and x or b( n-1)
9end 13end
10 14
11local c 15local c
12b = function( n) 16b = function( n)
13 print( "b", n) 17 print( "b", n)
14 return n <= 0 and n or c( n-1) 18 return n <= 0 and y or c( n-1)
15end 19end
16 20
17c = function( n) 21c = function( n)
18 print( "c", n) 22 print( "c", n)
19 return n <= 0 and n or a( n-1) 23 return n <= 0 and z or a( n-1)
20end 24end
21 25
22local g = lanes.gen( "*", a) 26local g = lanes.gen( "base", a)
23 27
24local l = g(10) 28local l = g(10)
25l:join() 29local r = l:join()
30print(r)