diff options
author | raffitz <raf.a.m.c.gon@gmail.com> | 2019-01-14 14:09:47 +0000 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-01-15 00:47:53 +0100 |
commit | 95fa71c6d2b4a2d86bc1e4a984efbd188fab1382 (patch) | |
tree | 349c0133f741a871cdf36c2423254d19d89b57da /test/functional | |
parent | 387ab4f7065c24f178ddb1c90e0378a1ea677314 (diff) | |
download | rneovim-95fa71c6d2b4a2d86bc1e4a984efbd188fab1382.tar.gz rneovim-95fa71c6d2b4a2d86bc1e4a984efbd188fab1382.tar.bz2 rneovim-95fa71c6d2b4a2d86bc1e4a984efbd188fab1382.zip |
:recover : Fix crash on non-existent *.swp #9504
Reverts d2944e6a298e. mf_open() _can_ fail if the file does not exist.
closes #9503
closes #9504
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/ex_cmds/swapfile_preserve_recover_spec.lua | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua index 3fcffd422f..bbab1471f6 100644 --- a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua +++ b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua @@ -1,10 +1,11 @@ local Screen = require('test.functional.ui.screen') local helpers = require('test.functional.helpers')(after_each) local lfs = require('lfs') -local feed_command, eq, eval, expect, source = - helpers.feed_command, helpers.eq, helpers.eval, helpers.expect, helpers.source +local eq, eval, expect, source = + helpers.eq, helpers.eval, helpers.expect, helpers.source local clear = helpers.clear local command = helpers.command +local expect_err = helpers.expect_err local feed = helpers.feed local nvim_prog = helpers.nvim_prog local ok = helpers.ok @@ -17,9 +18,14 @@ describe(':recover', function() before_each(clear) it('fails if given a non-existent swapfile', function() - local swapname = 'bogus-swapfile' - feed_command('recover '..swapname) -- This should not segfault. #2117 - eq('E305: No swap file found for '..swapname, eval('v:errmsg')) + local swapname = 'bogus_swapfile' + local swapname2 = 'bogus_swapfile.swp' + expect_err('E305: No swap file found for '..swapname, + command, 'recover '..swapname) -- Should not segfault. #2117 + -- Also check filename ending with ".swp". #9504 + expect_err('Vim%(recover%):E306: Cannot open '..swapname2, + command, 'recover '..swapname2) -- Should not segfault. #2117 + eq(2, eval('1+1')) -- Still alive? end) end) |