From e21f454e116441443208f5c31beb01f67191b47a Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 25 May 2018 07:42:59 -0400 Subject: [PATCH] fixup: always delete Xfile, fix exit code check after_each + os.remove ensures Xfile is deleted after every test. Windows exit code is inconsistent. --- test/functional/ex_cmds/write_spec.lua | 4 ++-- test/functional/legacy/delete_spec.lua | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/functional/ex_cmds/write_spec.lua b/test/functional/ex_cmds/write_spec.lua index 3060fb063b..3f54ff6f41 100644 --- a/test/functional/ex_cmds/write_spec.lua +++ b/test/functional/ex_cmds/write_spec.lua @@ -40,7 +40,7 @@ describe(':write', function() else command("silent !ln -s test_bkc_file.txt test_bkc_link.txt") end - if eval('v:shell_error') == 1 then + if eval('v:shell_error') ~= 0 then pending('Cannot create symlink', function()end) end source([[ @@ -60,7 +60,7 @@ describe(':write', function() else command("silent !ln -s test_bkc_file.txt test_bkc_link.txt") end - if eval('v:shell_error') == 1 then + if eval('v:shell_error') ~= 0 then pending('Cannot create symlink', function()end) end source([[ diff --git a/test/functional/legacy/delete_spec.lua b/test/functional/legacy/delete_spec.lua index b69caa6ef7..9ea3269828 100644 --- a/test/functional/legacy/delete_spec.lua +++ b/test/functional/legacy/delete_spec.lua @@ -4,6 +4,9 @@ local eq, eval, command = helpers.eq, helpers.eval, helpers.command describe('Test for delete()', function() before_each(clear) + after_each(function() + os.remove('Xfile') + end) it('file delete', function() command('split Xfile') @@ -52,8 +55,7 @@ describe('Test for delete()', function() silent !ln -s Xfile Xlink endif ]]) - if eval('v:shell_error') == 1 then - eq(0, eval("delete('Xfile')")) + if eval('v:shell_error') ~= 0 then pending('Cannot create symlink', function()end) end -- Delete the link, not the file