diff options
Diffstat (limited to 'test/functional/legacy/crash_spec.lua')
-rw-r--r-- | test/functional/legacy/crash_spec.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/functional/legacy/crash_spec.lua b/test/functional/legacy/crash_spec.lua index 04f77c7d4f..b63b3146f4 100644 --- a/test/functional/legacy/crash_spec.lua +++ b/test/functional/legacy/crash_spec.lua @@ -1,9 +1,14 @@ +local t = require('test.testutil') local n = require('test.functional.testnvim')() local assert_alive = n.assert_alive local clear = n.clear local command = n.command +local eq = t.eq +local eval = n.eval +local exec = n.exec local feed = n.feed +local pcall_err = t.pcall_err before_each(clear) @@ -32,3 +37,29 @@ it('no crash with very long option error message', function() pcall(command, 'source test/old/testdir/crash/poc_did_set_langmap') assert_alive() end) + +it('no crash when closing window with tag in loclist', function() + exec([[ + new + lexpr ['foo'] + lopen + let g:qf_bufnr = bufnr() + lclose + call settagstack(1, #{items: [#{tagname: 'foo', from: [g:qf_bufnr, 1, 1, 0]}]}) + ]]) + eq(1, eval('bufexists(g:qf_bufnr)')) + command('1close') + eq(0, eval('bufexists(g:qf_bufnr)')) + assert_alive() +end) + +it('no crash when writing "Untitled" file fails', function() + t.mkdir('Untitled') + finally(function() + vim.uv.fs_rmdir('Untitled') + end) + feed('ifoobar') + command('set bufhidden=unload') + eq('Vim(enew):E502: "Untitled" is a directory', pcall_err(command, 'confirm enew')) + assert_alive() +end) |