From 04f2f864e270e772c6326cefdf24947f0130e492 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 3 Jan 2024 02:09:18 +0100 Subject: refactor: format test/* --- test/functional/vimscript/errorlist_spec.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'test/functional/vimscript/errorlist_spec.lua') diff --git a/test/functional/vimscript/errorlist_spec.lua b/test/functional/vimscript/errorlist_spec.lua index 077d816903..b2afafe08c 100644 --- a/test/functional/vimscript/errorlist_spec.lua +++ b/test/functional/vimscript/errorlist_spec.lua @@ -24,10 +24,10 @@ 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'}) + setqflist({}, 'r', { ['title'] = 'qf_title' }) eq('qf_title', get_cur_win_var('quickfix_title')) end) @@ -38,7 +38,10 @@ describe('setqflist()', function() 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) @@ -73,11 +76,11 @@ describe('setloclist()', 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) -- cgit From 4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 13:11:28 +0000 Subject: test: normalise nvim bridge functions - remove helpers.cur*meths - remove helpers.nvim --- test/functional/vimscript/errorlist_spec.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/functional/vimscript/errorlist_spec.lua') diff --git a/test/functional/vimscript/errorlist_spec.lua b/test/functional/vimscript/errorlist_spec.lua index b2afafe08c..2977612247 100644 --- a/test/functional/vimscript/errorlist_spec.lua +++ b/test/functional/vimscript/errorlist_spec.lua @@ -4,7 +4,7 @@ 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.meths.nvim_win_get_var describe('setqflist()', function() local setqflist = helpers.funcs.setqflist @@ -26,15 +26,15 @@ describe('setqflist()', function() it('sets w:quickfix_title', function() setqflist({ '' }, 'r', 'foo') command('copen') - eq('foo', get_cur_win_var('quickfix_title')) + eq('foo', get_win_var(0, 'quickfix_title')) setqflist({}, 'r', { ['title'] = 'qf_title' }) - eq('qf_title', get_cur_win_var('quickfix_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() @@ -67,9 +67,9 @@ 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() -- cgit From 795f896a5772d5e0795f86642bdf90c82efac45c Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 17:59:57 +0000 Subject: test: rename (meths, funcs) -> (api, fn) --- test/functional/vimscript/errorlist_spec.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/functional/vimscript/errorlist_spec.lua') diff --git a/test/functional/vimscript/errorlist_spec.lua b/test/functional/vimscript/errorlist_spec.lua index 2977612247..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_win_var = helpers.meths.nvim_win_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) @@ -46,7 +46,7 @@ describe('setqflist()', function() end) describe('setloclist()', function() - local setloclist = helpers.funcs.setloclist + local setloclist = helpers.fn.setloclist before_each(clear) -- cgit