diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
commit | 7a7f497b483cd65e340064f23ed1c73425ecba0a (patch) | |
tree | d5c99ea22a1e10300d06165f8ac96df6b0dc59e1 /test/functional/vimscript/errorlist_spec.lua | |
parent | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (diff) | |
parent | ade1b12f49c3b3914c74847d791eb90ea90b56b7 (diff) | |
download | rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.gz rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.bz2 rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpost
Diffstat (limited to 'test/functional/vimscript/errorlist_spec.lua')
-rw-r--r-- | test/functional/vimscript/errorlist_spec.lua | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/test/functional/vimscript/errorlist_spec.lua b/test/functional/vimscript/errorlist_spec.lua index 077d816903..1e405e7e64 100644 --- a/test/functional/vimscript/errorlist_spec.lua +++ b/test/functional/vimscript/errorlist_spec.lua @@ -4,10 +4,10 @@ local clear = helpers.clear local command = helpers.command local eq = helpers.eq local exc_exec = helpers.exc_exec -local get_cur_win_var = helpers.curwinmeths.get_var +local get_win_var = helpers.api.nvim_win_get_var describe('setqflist()', function() - local setqflist = helpers.funcs.setqflist + local setqflist = helpers.fn.setqflist before_each(clear) @@ -24,26 +24,29 @@ describe('setqflist()', function() end) it('sets w:quickfix_title', function() - setqflist({''}, 'r', 'foo') + setqflist({ '' }, 'r', 'foo') command('copen') - eq('foo', get_cur_win_var('quickfix_title')) - setqflist({}, 'r', {['title'] = 'qf_title'}) - eq('qf_title', get_cur_win_var('quickfix_title')) + eq('foo', get_win_var(0, 'quickfix_title')) + setqflist({}, 'r', { ['title'] = 'qf_title' }) + eq('qf_title', get_win_var(0, 'quickfix_title')) end) it('allows string {what} for backwards compatibility', function() setqflist({}, 'r', '5') command('copen') - eq('5', get_cur_win_var('quickfix_title')) + eq('5', get_win_var(0, 'quickfix_title')) end) it('requires a dict for {what}', function() - eq('Vim(call):E715: Dictionary required', exc_exec('call setqflist([], "r", function("function"))')) + eq( + 'Vim(call):E715: Dictionary required', + exc_exec('call setqflist([], "r", function("function"))') + ) end) end) describe('setloclist()', function() - local setloclist = helpers.funcs.setloclist + local setloclist = helpers.fn.setloclist before_each(clear) @@ -64,20 +67,20 @@ describe('setloclist()', function() setloclist(1, {}, 'r', 'foo') setloclist(2, {}, 'r', 'bar') command('lopen') - eq('bar', get_cur_win_var('quickfix_title')) + eq('bar', get_win_var(0, 'quickfix_title')) command('lclose | wincmd w | lopen') - eq('foo', get_cur_win_var('quickfix_title')) + eq('foo', get_win_var(0, 'quickfix_title')) end) it("doesn't crash when when window is closed in the middle #13721", function() helpers.insert([[ hello world]]) - command("vsplit") - command("autocmd WinLeave * :call nvim_win_close(0, v:true)") + command('vsplit') + command('autocmd WinLeave * :call nvim_win_close(0, v:true)') - command("call setloclist(0, [])") - command("lopen") + command('call setloclist(0, [])') + command('lopen') helpers.assert_alive() end) |