diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manual_register.lua | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/manual_register.lua b/tests/manual_register.lua index a8f2098..5220cf8 100644 --- a/tests/manual_register.lua +++ b/tests/manual_register.lua | |||
@@ -1,6 +1,3 @@ | |||
1 | |||
2 | local register_func = true | ||
3 | |||
4 | local RequireAModuleThatExportsGlobalFunctions = function(type_) | 1 | local RequireAModuleThatExportsGlobalFunctions = function(type_) |
5 | -- grab some module that exports C functions, this is good enough for our purpose | 2 | -- grab some module that exports C functions, this is good enough for our purpose |
6 | local lfs = require "lfs" | 3 | local lfs = require "lfs" |
@@ -8,14 +5,12 @@ local RequireAModuleThatExportsGlobalFunctions = function(type_) | |||
8 | GlobalFunc = lfs.attributes | 5 | GlobalFunc = lfs.attributes |
9 | -- we need to register it so that it is transferable | 6 | -- we need to register it so that it is transferable |
10 | local lanes = require "lanes" | 7 | local lanes = require "lanes" |
11 | if register_func then | 8 | lanes.register( "GlobalFunc", GlobalFunc) |
12 | lanes.register( "GlobalFunc", GlobalFunc) | ||
13 | end | ||
14 | print(type_, "RequireAModuleThatExportsGlobalFunctions done:", lanes.nameof(GlobalFunc)) | 9 | print(type_, "RequireAModuleThatExportsGlobalFunctions done:", lanes.nameof(GlobalFunc)) |
15 | end | 10 | end |
16 | 11 | ||
17 | 12 | ||
18 | local lanes = require "lanes".configure{ with_timers = false, on_state_create = RequireAModuleThatExportsGlobalFunctions} | 13 | local lanes = require "lanes".configure{on_state_create = RequireAModuleThatExportsGlobalFunctions} |
19 | 14 | ||
20 | -- load some module that adds C functions to the global space | 15 | -- load some module that adds C functions to the global space |
21 | RequireAModuleThatExportsGlobalFunctions("main") | 16 | RequireAModuleThatExportsGlobalFunctions("main") |