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/encode_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/encode_spec.lua')
-rw-r--r-- | test/unit/eval/encode_spec.lua | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/test/unit/eval/encode_spec.lua b/test/unit/eval/encode_spec.lua index 98fc8305e0..1f065e59a1 100644 --- a/test/unit/eval/encode_spec.lua +++ b/test/unit/eval/encode_spec.lua @@ -1,4 +1,5 @@ local helpers = require('test.unit.helpers') +local itp = helpers.gen_itp(it) local eval_helpers = require('test.unit.eval.helpers') local cimport = helpers.cimport @@ -18,25 +19,25 @@ describe('encode_list_write()', function() return encode.encode_list_write(l, to_cstr(s), #s) end - it('writes empty string', function() + itp('writes empty string', function() local l = list() eq(0, encode_list_write(l, '')) eq({[type_key]=list_type}, lst2tbl(l)) end) - it('writes ASCII string literal with printable characters', function() + itp('writes ASCII string literal with printable characters', function() local l = list() eq(0, encode_list_write(l, 'abc')) eq({'abc'}, lst2tbl(l)) end) - it('writes string starting with NL', function() + itp('writes string starting with NL', function() local l = list() eq(0, encode_list_write(l, '\nabc')) eq({null_string, 'abc'}, lst2tbl(l)) end) - it('writes string starting with NL twice', function() + itp('writes string starting with NL twice', function() local l = list() eq(0, encode_list_write(l, '\nabc')) eq({null_string, 'abc'}, lst2tbl(l)) @@ -44,13 +45,13 @@ describe('encode_list_write()', function() eq({null_string, 'abc', 'abc'}, lst2tbl(l)) end) - it('writes string ending with NL', function() + itp('writes string ending with NL', function() local l = list() eq(0, encode_list_write(l, 'abc\n')) eq({'abc', null_string}, lst2tbl(l)) end) - it('writes string ending with NL twice', function() + itp('writes string ending with NL twice', function() local l = list() eq(0, encode_list_write(l, 'abc\n')) eq({'abc', null_string}, lst2tbl(l)) @@ -58,7 +59,7 @@ describe('encode_list_write()', function() eq({'abc', 'abc', null_string}, lst2tbl(l)) end) - it('writes string starting, ending and containing NL twice', function() + itp('writes string starting, ending and containing NL twice', function() local l = list() eq(0, encode_list_write(l, '\na\nb\n')) eq({null_string, 'a', 'b', null_string}, lst2tbl(l)) @@ -66,7 +67,7 @@ describe('encode_list_write()', function() eq({null_string, 'a', 'b', null_string, 'a', 'b', null_string}, lst2tbl(l)) end) - it('writes string starting, ending and containing NUL with NL between twice', function() + itp('writes string starting, ending and containing NUL with NL between twice', function() local l = list() eq(0, encode_list_write(l, '\0\n\0\n\0')) eq({'\n', '\n', '\n'}, lst2tbl(l)) @@ -74,7 +75,7 @@ describe('encode_list_write()', function() eq({'\n', '\n', '\n\n', '\n', '\n'}, lst2tbl(l)) end) - it('writes string starting, ending and containing NL with NUL between twice', function() + itp('writes string starting, ending and containing NL with NUL between twice', function() local l = list() eq(0, encode_list_write(l, '\n\0\n\0\n')) eq({null_string, '\n', '\n', null_string}, lst2tbl(l)) @@ -82,7 +83,7 @@ describe('encode_list_write()', function() eq({null_string, '\n', '\n', null_string, '\n', '\n', null_string}, lst2tbl(l)) end) - it('writes string containing a single NL twice', function() + itp('writes string containing a single NL twice', function() local l = list() eq(0, encode_list_write(l, '\n')) eq({null_string, null_string}, lst2tbl(l)) @@ -90,7 +91,7 @@ describe('encode_list_write()', function() eq({null_string, null_string, null_string}, lst2tbl(l)) end) - it('writes string containing a few NLs twice', function() + itp('writes string containing a few NLs twice', function() local l = list() eq(0, encode_list_write(l, '\n\n\n')) eq({null_string, null_string, null_string, null_string}, lst2tbl(l)) |