test: Extend {unit,functional}.helpers with global helpers

Automatically include all "global helper" util functions in the
unit.helpers and functional.helpers and modules.  So tests don't need to
expicitly do:

    local global_helpers = require('test.helpers')
This commit is contained in:
Justin M. Keyes
2018-11-29 23:26:21 +01:00
parent 8e22c4510e
commit 2b87485c22
4 changed files with 37 additions and 30 deletions

View File

@@ -15,7 +15,6 @@ local dedent = global_helpers.dedent
local neq = global_helpers.neq
local map = global_helpers.map
local eq = global_helpers.eq
local ok = global_helpers.ok
-- C constants.
local NULL = ffi.cast('void*', 0)
@@ -842,9 +841,6 @@ local module = {
cimport = cimport,
cppimport = cppimport,
internalize = internalize,
ok = ok,
eq = eq,
neq = neq,
ffi = ffi,
lib = lib,
cstr = cstr,
@@ -869,6 +865,7 @@ local module = {
ptr2key = ptr2key,
debug_log = debug_log,
}
module = global_helpers.map_extend('error', module, global_helpers)
return function()
return module
end