diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-04-15 18:31:30 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-04-15 18:31:30 +0200 |
commit | e7276bee137b87a2323b125a6a8c792de73819eb (patch) | |
tree | 0457187b99121a8935823e0b6c858808ffeb1d29 /tests | |
parent | c21b52ad18bcabf084f8dba40d1a09d9e52051bd (diff) | |
download | lanes-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.lua | 17 |
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 | ||
5 | local x = 33 | ||
6 | local y = 44 | ||
7 | local z = 55 | ||
8 | |||
5 | local b | 9 | local b |
6 | local a = function( n) | 10 | local 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) |
9 | end | 13 | end |
10 | 14 | ||
11 | local c | 15 | local c |
12 | b = function( n) | 16 | b = 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) |
15 | end | 19 | end |
16 | 20 | ||
17 | c = function( n) | 21 | c = 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) |
20 | end | 24 | end |
21 | 25 | ||
22 | local g = lanes.gen( "*", a) | 26 | local g = lanes.gen( "base", a) |
23 | 27 | ||
24 | local l = g(10) | 28 | local l = g(10) |
25 | l:join() | 29 | local r = l:join() |
30 | print(r) | ||