aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-04-15 18:31:30 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-04-15 18:31:30 +0200
commite7276bee137b87a2323b125a6a8c792de73819eb (patch)
tree0457187b99121a8935823e0b6c858808ffeb1d29 /tests
parentc21b52ad18bcabf084f8dba40d1a09d9e52051bd (diff)
downloadlanes-e7276bee137b87a2323b125a6a8c792de73819eb.tar.gz
lanes-e7276bee137b87a2323b125a6a8c792de73819eb.tar.bz2
lanes-e7276bee137b87a2323b125a6a8c792de73819eb.zip
C++ migration: inter-state transfer managed by a new class InterCopyContext
Diffstat (limited to 'tests')
-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)