diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-09-11 05:06:58 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-09-11 05:06:58 -0400 |
commit | 1da3398095b81a1f579a2d8d19864fdad8de0bde (patch) | |
tree | 53b6764cd02f55d11ff6f6f56a91d358b367ea7d /test/unit/formatc.lua | |
parent | 7577c31ed08b0f4e1426f9e6a1da7d5fd55440bb (diff) | |
parent | 99a9161bace8200aa611f6feefcc2ac3eda93251 (diff) | |
download | rneovim-1da3398095b81a1f579a2d8d19864fdad8de0bde.tar.gz rneovim-1da3398095b81a1f579a2d8d19864fdad8de0bde.tar.bz2 rneovim-1da3398095b81a1f579a2d8d19864fdad8de0bde.zip |
Merge pull request #1144 from justinmk/fixtests
fix unittest issues with busted 2.x
Diffstat (limited to 'test/unit/formatc.lua')
-rw-r--r-- | test/unit/formatc.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/unit/formatc.lua b/test/unit/formatc.lua index bafaf09310..792894f349 100644 --- a/test/unit/formatc.lua +++ b/test/unit/formatc.lua @@ -212,18 +212,21 @@ local function formatc(str) return table.concat(result) end --- uncomment the following lines (and comment the return) for standalone --- operation (very handy for debugging) +-- standalone operation (very handy for debugging) local function standalone(...) Preprocess = require("preprocess") Preprocess.add_to_include_path('./../../src') Preprocess.add_to_include_path('./../../build/include') Preprocess.add_to_include_path('./../../.deps/usr/include') - input = Preprocess.preprocess_stream(arg[1]) + local input = Preprocess.preprocess_stream(arg[1]) local raw = input:read('*all') input:close() + if raw == nil then + print("ERROR: Preprocess.preprocess_stream():read() returned empty") + end + local formatted if #arg == 2 and arg[2] == 'no' then formatted = raw @@ -233,6 +236,9 @@ local function standalone(...) print(formatted) end +-- uncomment this line (and comment the `return`) for standalone debugging +-- example usage: +-- ../../.deps/usr/bin/luajit formatc.lua ../../include/tempfile.h.generated.h +-- ../../.deps/usr/bin/luajit formatc.lua /usr/include/malloc.h -- standalone(...) - return formatc |