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/fileio_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/fileio_spec.lua')
-rw-r--r-- | test/unit/fileio_spec.lua | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/test/unit/fileio_spec.lua b/test/unit/fileio_spec.lua index 3e3c36617d..13ff5d1f11 100644 --- a/test/unit/fileio_spec.lua +++ b/test/unit/fileio_spec.lua @@ -1,4 +1,5 @@ local helpers = require("test.unit.helpers") +local itp = helpers.gen_itp(it) --{:cimport, :internalize, :eq, :neq, :ffi, :lib, :cstr, :to_cstr} = require 'test.unit.helpers' local eq = helpers.eq @@ -16,67 +17,67 @@ describe('file_pat functions', function() return ffi.string(res) end - it('returns ^path$ regex for literal path input', function() + itp('returns ^path$ regex for literal path input', function() eq( '^path$', file_pat_to_reg_pat('path')) end) - it('does not prepend ^ when there is a starting glob (*)', function() + itp('does not prepend ^ when there is a starting glob (*)', function() eq('path$', file_pat_to_reg_pat('*path')) end) - it('does not append $ when there is an ending glob (*)', function() + itp('does not append $ when there is an ending glob (*)', function() eq('^path', file_pat_to_reg_pat('path*')) end) - it('does not include ^ or $ when surrounded by globs (*)', function() + itp('does not include ^ or $ when surrounded by globs (*)', function() eq('path', file_pat_to_reg_pat('*path*')) end) - it('replaces the bash any character (?) with the regex any character (.)', function() + itp('replaces the bash any character (?) with the regex any character (.)', function() eq('^foo.bar$', file_pat_to_reg_pat('foo?bar')) end) - it('replaces a glob (*) in the middle of a path with regex multiple any character (.*)', + itp('replaces a glob (*) in the middle of a path with regex multiple any character (.*)', function() eq('^foo.*bar$', file_pat_to_reg_pat('foo*bar')) end) - it([[unescapes \? to ?]], function() + itp([[unescapes \? to ?]], function() eq('^foo?bar$', file_pat_to_reg_pat([[foo\?bar]])) end) - it([[unescapes \% to %]], function() + itp([[unescapes \% to %]], function() eq('^foo%bar$', file_pat_to_reg_pat([[foo\%bar]])) end) - it([[unescapes \, to ,]], function() + itp([[unescapes \, to ,]], function() eq('^foo,bar$', file_pat_to_reg_pat([[foo\,bar]])) end) - it([[unescapes '\ ' to ' ']], function() + itp([[unescapes '\ ' to ' ']], function() eq('^foo bar$', file_pat_to_reg_pat([[foo\ bar]])) end) - it([[escapes . to \.]], function() + itp([[escapes . to \.]], function() eq([[^foo\.bar$]], file_pat_to_reg_pat('foo.bar')) end) - it('Converts bash brace expansion {a,b} to regex options (a|b)', function() + itp('Converts bash brace expansion {a,b} to regex options (a|b)', function() eq([[^foo\(bar\|baz\)$]], file_pat_to_reg_pat('foo{bar,baz}')) end) - it('Collapses multiple consecutive * into a single character', function() + itp('Collapses multiple consecutive * into a single character', function() eq([[^foo.*bar$]], file_pat_to_reg_pat('foo*******bar')) eq([[foobar$]], file_pat_to_reg_pat('********foobar')) eq([[^foobar]], file_pat_to_reg_pat('foobar********')) end) - it('Does not escape ^', function() + itp('Does not escape ^', function() eq([[^^blah$]], file_pat_to_reg_pat('^blah')) eq([[^foo^bar$]], file_pat_to_reg_pat('foo^bar')) end) - it('Does not escape $', function() + itp('Does not escape $', function() eq([[^blah$$]], file_pat_to_reg_pat('blah$')) eq([[^foo$bar$]], file_pat_to_reg_pat('foo$bar')) end) |