aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-05-02 10:18:37 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-05-02 10:18:37 +0200
commit84889233bfec4ad11ee1160fe63acbbbba7275e7 (patch)
tree236643b48bbc1a31f26a70d702a7e3f6b93b723f /tests
parent8e64f794f08cb3e4f930df5bb17c3a7061516cca (diff)
downloadlanes-84889233bfec4ad11ee1160fe63acbbbba7275e7.tar.gz
lanes-84889233bfec4ad11ee1160fe63acbbbba7275e7.tar.bz2
lanes-84889233bfec4ad11ee1160fe63acbbbba7275e7.zip
Progressively applying the coding rules
Diffstat (limited to 'tests')
-rw-r--r--tests/manual_register.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/manual_register.lua b/tests/manual_register.lua
index b868bb9..23b33c1 100644
--- a/tests/manual_register.lua
+++ b/tests/manual_register.lua
@@ -7,11 +7,11 @@ local RequireAModuleThatExportsGlobalFunctions = function()
7 -- make one of these a global 7 -- make one of these a global
8 GlobalFunc = lfs.attributes 8 GlobalFunc = lfs.attributes
9 -- we need to register it so that it is transferable 9 -- we need to register it so that it is transferable
10 local lanes = require "lanes"
10 if register_func then 11 if register_func then
11 local lanes = require "lanes"
12 lanes.register( "GlobalFunc", GlobalFunc) 12 lanes.register( "GlobalFunc", GlobalFunc)
13 end 13 end
14 print "RequireAModuleThatExportsGlobalFunctions done" 14 print("RequireAModuleThatExportsGlobalFunctions done:", lanes.nameof(GlobalFunc))
15end 15end
16 16
17 17
@@ -25,11 +25,13 @@ local GlobalFuncUpval = GlobalFunc
25-- a lane that makes use of the above global 25-- a lane that makes use of the above global
26local f = function() 26local f = function()
27 GlobalFuncUpval("foo") 27 GlobalFuncUpval("foo")
28 print "f done" 28 print("f done:", lanes.nameof(GlobalFuncUpval))
29 return 33
29end 30end
30 31
31 32
32local g = lanes.gen( "*", f) 33local g = lanes.gen( "*", f)
33 34
34-- generate a lane, this will transfer f, which pulls GlobalFunc. 35-- generate a lane, this will transfer f, which pulls GlobalFunc.
35local h = g() \ No newline at end of file 36local h = g()
37assert(h[1] == 33)