aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/rupval.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/rupval.lua b/tests/rupval.lua
new file mode 100644
index 0000000..7b5a270
--- /dev/null
+++ b/tests/rupval.lua
@@ -0,0 +1,25 @@
1lanes = require "lanes".configure{with_timers=false}
2
3-- make sure we can copy functions with interdependant upvalues
4
5local b
6local a = function( n)
7 print( "a", n)
8 return n <= 0 and n or b( n-1)
9end
10
11local c
12b = function( n)
13 print( "b", n)
14 return n <= 0 and n or c( n-1)
15end
16
17c = function( n)
18 print( "c", n)
19 return n <= 0 and n or a( n-1)
20end
21
22local g = lanes.gen( "*", a)
23
24local l = g(10)
25l:join()