diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-01-04 11:54:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-04 11:54:11 +0100 |
commit | af828f22575c8591a176bd9d85ee07f87ba8b911 (patch) | |
tree | c4692cf380b69e8d3b6065d1f8d2855b6e4a50dd /test/unit/helpers.lua | |
parent | c56411ed87fe560149b68e67f63916f829affd1b (diff) | |
parent | 937b6fac8fecb701895b2c4151a864861aaf03f4 (diff) | |
download | rneovim-af828f22575c8591a176bd9d85ee07f87ba8b911.tar.gz rneovim-af828f22575c8591a176bd9d85ee07f87ba8b911.tar.bz2 rneovim-af828f22575c8591a176bd9d85ee07f87ba8b911.zip |
Merge #5864 from ZyX-I/fix-5857
unittest: Allow multiple indirect includes
Diffstat (limited to 'test/unit/helpers.lua')
-rw-r--r-- | test/unit/helpers.lua | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua index 3564f76442..a485a875ab 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(...) @@ -66,17 +68,8 @@ local function cimport(...) return libnvim end - local body = nil - for _ = 1, 10 do - local stream = Preprocess.preprocess_stream(unpack(paths)) - body = stream:read("*a") - stream:close() - if body ~= nil then break end - end - - if body == nil then - print("ERROR: helpers.lua: Preprocess.preprocess_stream():read() returned empty") - end + local body + body, previous_defines = Preprocess.preprocess(previous_defines, unpack(paths)) -- format it (so that the lines are "unique" statements), also filter out -- Objective-C blocks |