diff options
author | ZyX <kp-pav@yandex.ru> | 2017-03-05 04:02:45 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-11 23:23:30 +0300 |
commit | 12b062b2c862fd436cff0df4ebb2e5ca22e75e19 (patch) | |
tree | 47cb394b68714d419728e7aca87b9bac909df96f /test/unit/eval/decode_spec.lua | |
parent | 5898b42d82a5a4b594879f30d84611c98ce6bd54 (diff) | |
download | rneovim-12b062b2c862fd436cff0df4ebb2e5ca22e75e19.tar.gz rneovim-12b062b2c862fd436cff0df4ebb2e5ca22e75e19.tar.bz2 rneovim-12b062b2c862fd436cff0df4ebb2e5ca22e75e19.zip |
unittests: Run all unit tests in their own processes
Used
sed -r -i -e '/ helpers =/ s/$/\nlocal itp = helpers.gen_itp(it)/; s/^(\s*)it\(/\1itp(/' test/unit/**/*_spec.lua
to alter all tests. Locally they all run fine now.
Reasoning:
1. General: state from one test should not affect other tests.
2. Local: travis build is failing with something which may be an output of
garbage collector. This should prevent state of the garbage collector from
interferring as well.
Diffstat (limited to 'test/unit/eval/decode_spec.lua')
-rw-r--r-- | test/unit/eval/decode_spec.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/unit/eval/decode_spec.lua b/test/unit/eval/decode_spec.lua index 742b754d8a..03fe556001 100644 --- a/test/unit/eval/decode_spec.lua +++ b/test/unit/eval/decode_spec.lua @@ -1,4 +1,5 @@ local helpers = require('test.unit.helpers') +local itp = helpers.gen_itp(it) local cimport = helpers.cimport local to_cstr = helpers.to_cstr @@ -29,7 +30,7 @@ describe('json_decode_string()', function() return ffi.gc(decode.xmemdup(c, 1), decode.xfree) end - it('does not overflow when running with `n…`, `t…`, `f…`', function() + itp('does not overflow when running with `n…`, `t…`, `f…`', function() local rettv = ffi.new('typval_T', {v_type=decode.VAR_UNKNOWN}) decode.emsg_silent = 1 -- This will not crash, but if `len` argument will be ignored it will parse @@ -56,7 +57,7 @@ describe('json_decode_string()', function() eq(decode.VAR_UNKNOWN, rettv.v_type) end) - it('does not overflow and crash when running with `n`, `t`, `f`', function() + itp('does not overflow and crash when running with `n`, `t`, `f`', function() local rettv = ffi.new('typval_T', {v_type=decode.VAR_UNKNOWN}) decode.emsg_silent = 1 eq(0, decode.json_decode_string(char('n'), 1, rettv)) @@ -67,7 +68,7 @@ describe('json_decode_string()', function() eq(decode.VAR_UNKNOWN, rettv.v_type) end) - it('does not overflow when running with `"…`', function() + itp('does not overflow when running with `"…`', function() local rettv = ffi.new('typval_T', {v_type=decode.VAR_UNKNOWN}) decode.emsg_silent = 1 eq(0, decode.json_decode_string('"t"', 2, rettv)) @@ -84,7 +85,7 @@ describe('json_decode_string()', function() eq(msg, ffi.string(decode.last_msg_hist.msg)) end - it('does not overflow in error messages', function() + itp('does not overflow in error messages', function() check_failure(']test', 1, 'E474: No container to close: ]') check_failure('[}test', 2, 'E474: Closing list with curly bracket: }') check_failure('{]test', 2, @@ -129,11 +130,11 @@ describe('json_decode_string()', function() check_failure('[1test', 2, 'E474: Unexpected end of input: [1') end) - it('does not overflow with `-`', function() + itp('does not overflow with `-`', function() check_failure('-0', 1, 'E474: Missing number after minus sign: -') end) - it('does not overflow and crash when running with `"`', function() + itp('does not overflow and crash when running with `"`', function() local rettv = ffi.new('typval_T', {v_type=decode.VAR_UNKNOWN}) decode.emsg_silent = 1 eq(0, decode.json_decode_string(char('"'), 1, rettv)) |