aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2013-01-10 06:16:36 -0800
committerBenoit Germain <bnt.germain@gmail.com>2013-01-10 06:16:36 -0800
commitda33bf20d6907a9f783e4a3015105a353d4d956e (patch)
tree8f9770774a47c7347bed81cf4bbca225a196a406 /tests
parent01fd6fd07cd0f9332dadbcc3fd9218c28a0527a1 (diff)
downloadlanes-da33bf20d6907a9f783e4a3015105a353d4d956e.tar.gz
lanes-da33bf20d6907a9f783e4a3015105a353d4d956e.tar.bz2
lanes-da33bf20d6907a9f783e4a3015105a353d4d956e.zip
Create rupval.lua
Diffstat (limited to 'tests')
-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()