aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/manual_register.lua6
-rw-r--r--tests/package.lua8
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/manual_register.lua b/tests/manual_register.lua
index 23b33c1..a8f2098 100644
--- a/tests/manual_register.lua
+++ b/tests/manual_register.lua
@@ -1,7 +1,7 @@
1 1
2local register_func = true 2local register_func = true
3 3
4local RequireAModuleThatExportsGlobalFunctions = function() 4local RequireAModuleThatExportsGlobalFunctions = function(type_)
5 -- grab some module that exports C functions, this is good enough for our purpose 5 -- grab some module that exports C functions, this is good enough for our purpose
6 local lfs = require "lfs" 6 local lfs = require "lfs"
7 -- make one of these a global 7 -- make one of these a global
@@ -11,14 +11,14 @@ local RequireAModuleThatExportsGlobalFunctions = function()
11 if register_func then 11 if register_func then
12 lanes.register( "GlobalFunc", GlobalFunc) 12 lanes.register( "GlobalFunc", GlobalFunc)
13 end 13 end
14 print("RequireAModuleThatExportsGlobalFunctions done:", lanes.nameof(GlobalFunc)) 14 print(type_, "RequireAModuleThatExportsGlobalFunctions done:", lanes.nameof(GlobalFunc))
15end 15end
16 16
17 17
18local lanes = require "lanes".configure{ with_timers = false, on_state_create = RequireAModuleThatExportsGlobalFunctions} 18local lanes = require "lanes".configure{ with_timers = false, on_state_create = RequireAModuleThatExportsGlobalFunctions}
19 19
20-- load some module that adds C functions to the global space 20-- load some module that adds C functions to the global space
21RequireAModuleThatExportsGlobalFunctions() 21RequireAModuleThatExportsGlobalFunctions("main")
22 22
23local GlobalFuncUpval = GlobalFunc 23local GlobalFuncUpval = GlobalFunc
24 24
diff --git a/tests/package.lua b/tests/package.lua
index de11c9e..4e8b59f 100644
--- a/tests/package.lua
+++ b/tests/package.lua
@@ -2,21 +2,21 @@ local loaders = package.loaders or package.searchers
2 2
3assert(nil == loaders[5]) 3assert(nil == loaders[5])
4 4
5local configure_loaders = function() 5local configure_loaders = function(type_)
6 table.insert(loaders, 4, function() end) 6 table.insert(loaders, 4, function() end)
7 assert(loaders[1]) 7 assert(loaders[1])
8 assert(loaders[2]) 8 assert(loaders[2])
9 assert(loaders[3]) 9 assert(loaders[3])
10 assert(loaders[4]) 10 assert(loaders[4])
11 assert(loaders[5]) 11 assert(loaders[5])
12 print "loaders configured!" 12 print(type_, "loaders configured!")
13end 13end
14 14
15configure_loaders() 15configure_loaders("main")
16 16
17for k,v in pairs(loaders) do 17for k,v in pairs(loaders) do
18 print( k, type(v)) 18 print( k, type(v))
19end 19end
20 20
21lanes = require "lanes" 21lanes = require "lanes"
22lanes.configure{with_timers=false, on_state_create = configure_loaders} \ No newline at end of file 22lanes.configure{on_state_create = configure_loaders} \ No newline at end of file