aboutsummaryrefslogtreecommitdiff
path: root/test/unit/formatc.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-01-03 08:46:44 +0300
committerZyX <kp-pav@yandex.ru>2017-01-03 22:54:54 +0300
commit410d18ef5c24a325f4d63c9b01991015199194c2 (patch)
treea6e2acad16f222e35c2c0be979d0396cc1a17813 /test/unit/formatc.lua
parentefe1476d4293170496f0e933a4d3c955f0559b03 (diff)
downloadrneovim-410d18ef5c24a325f4d63c9b01991015199194c2.tar.gz
rneovim-410d18ef5c24a325f4d63c9b01991015199194c2.tar.bz2
rneovim-410d18ef5c24a325f4d63c9b01991015199194c2.zip
unittest: Allow multiple indirect includes
Works by saving all preprocessor defines and reusing them on each run. This also saves NVIM_HEADER_H defines. Saving other defines is needed for defines like `Map(foo, bar)` which are sometimes used to declare types or functions. Saving types or function declarations is not needed because they are recorded as luajit state. Fixes #5857
Diffstat (limited to 'test/unit/formatc.lua')
-rw-r--r--test/unit/formatc.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/unit/formatc.lua b/test/unit/formatc.lua
index 00637e0b8d..9b47a318f0 100644
--- a/test/unit/formatc.lua
+++ b/test/unit/formatc.lua
@@ -219,12 +219,10 @@ local function standalone(...) -- luacheck: ignore
Preprocess.add_to_include_path('./../../build/include')
Preprocess.add_to_include_path('./../../.deps/usr/include')
- local input = Preprocess.preprocess_stream(arg[1])
- local raw = input:read('*all')
- input:close()
+ local raw = Preprocess.preprocess(arg[1])
if raw == nil then
- print("ERROR: Preprocess.preprocess_stream():read() returned empty")
+ print("ERROR: Preprocess.preprocess() returned empty")
end
local formatted