diff options
author | ZyX <kp-pav@yandex.ru> | 2017-11-19 22:32:02 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-11-19 22:32:02 +0300 |
commit | 64158f2b0b8f0d2e058f7be6f0a0c3faa7de5f22 (patch) | |
tree | 78ab227b513f079e1268b6e68fff84c9e8f61888 | |
parent | fe3a58273e7665e795e0402c961fad869f4e34f9 (diff) | |
download | rneovim-64158f2b0b8f0d2e058f7be6f0a0c3faa7de5f22.tar.gz rneovim-64158f2b0b8f0d2e058f7be6f0a0c3faa7de5f22.tar.bz2 rneovim-64158f2b0b8f0d2e058f7be6f0a0c3faa7de5f22.zip |
unittests: Populate ARGTYPES in child process only
-rw-r--r-- | test/unit/charset/vim_str2nr_spec.lua | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/unit/charset/vim_str2nr_spec.lua b/test/unit/charset/vim_str2nr_spec.lua index 22504649f6..1a0a000abb 100644 --- a/test/unit/charset/vim_str2nr_spec.lua +++ b/test/unit/charset/vim_str2nr_spec.lua @@ -3,6 +3,7 @@ local global_helpers = require('test.helpers') local itp = helpers.gen_itp(it) +local child_call_once = helpers.child_call_once local cimport = helpers.cimport local ffi = helpers.ffi @@ -11,12 +12,16 @@ local updated = global_helpers.updated local lib = cimport('./src/nvim/charset.h') -local ARGTYPES = { - num = ffi.typeof('varnumber_T[1]'), - unum = ffi.typeof('uvarnumber_T[1]'), - pre = ffi.typeof('int[1]'), - len = ffi.typeof('int[1]'), -} +local ARGTYPES + +child_call_once(function() + ARGTYPES = { + num = ffi.typeof('varnumber_T[1]'), + unum = ffi.typeof('uvarnumber_T[1]'), + pre = ffi.typeof('int[1]'), + len = ffi.typeof('int[1]'), + } +end) local icnt = -42 local ucnt = 4242 |