aboutsummaryrefslogtreecommitdiff
path: root/test/unit/helpers.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-01-03 08:57:43 +0300
committerZyX <kp-pav@yandex.ru>2017-01-03 22:54:54 +0300
commit0d7b779cab198c89b70bf9d1e6d42cffc3f28f50 (patch)
tree45324590a09ee5fc289b12195eed9d614975a6df /test/unit/helpers.lua
parent410d18ef5c24a325f4d63c9b01991015199194c2 (diff)
downloadrneovim-0d7b779cab198c89b70bf9d1e6d42cffc3f28f50.tar.gz
rneovim-0d7b779cab198c89b70bf9d1e6d42cffc3f28f50.tar.bz2
rneovim-0d7b779cab198c89b70bf9d1e6d42cffc3f28f50.zip
unittest: Record previous defines in another place
Previous commit made preprocess.lua know how its output will be used. This moves state to cimport, making only it know which is cleaner.
Diffstat (limited to 'test/unit/helpers.lua')
-rw-r--r--test/unit/helpers.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua
index c9885f73d0..abbdecacc9 100644
--- a/test/unit/helpers.lua
+++ b/test/unit/helpers.lua
@@ -45,6 +45,8 @@ local function filter_complex_blocks(body)
return table.concat(result, "\n")
end
+local previous_defines = ''
+
-- use this helper to import C files, you can pass multiple paths at once,
-- this helper will return the C namespace of the nvim library.
local function cimport(...)
@@ -68,7 +70,7 @@ local function cimport(...)
local body = nil
for _ = 1, 10 do
- body = Preprocess.preprocess(unpack(paths))
+ body, previous_defines = Preprocess.preprocess(previous_defines, unpack(paths))
if body ~= nil then break end
end