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/wait_spec.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/functional/vimscript/wait_spec.lua') diff --git a/test/functional/vimscript/wait_spec.lua b/test/functional/vimscript/wait_spec.lua index ee95e02a7f..03cdbc12fa 100644 --- a/test/functional/vimscript/wait_spec.lua +++ b/test/functional/vimscript/wait_spec.lua @@ -36,11 +36,12 @@ describe('wait()', function() end) it('returns -2 when interrupted', function() - feed_command('call rpcnotify(g:channel, "ready") | '.. - 'call rpcnotify(g:channel, "wait", wait(-1, 0))') - eq({'notification', 'ready', {}}, next_msg()) + feed_command( + 'call rpcnotify(g:channel, "ready") | ' .. 'call rpcnotify(g:channel, "wait", wait(-1, 0))' + ) + eq({ 'notification', 'ready', {} }, next_msg()) feed('') - eq({'notification', 'wait', {-2}}, next_msg()) + eq({ 'notification', 'wait', { -2 } }, next_msg()) end) it('returns -3 on error', function() -- 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/wait_spec.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/functional/vimscript/wait_spec.lua') diff --git a/test/functional/vimscript/wait_spec.lua b/test/functional/vimscript/wait_spec.lua index 03cdbc12fa..e6b244538d 100644 --- a/test/functional/vimscript/wait_spec.lua +++ b/test/functional/vimscript/wait_spec.lua @@ -7,14 +7,14 @@ local eq = helpers.eq local feed = helpers.feed local feed_command = helpers.feed_command local next_msg = helpers.next_msg -local nvim = helpers.nvim +local meths = helpers.meths local source = helpers.source local pcall_err = helpers.pcall_err before_each(function() clear() - local channel = nvim('get_api_info')[1] - nvim('set_var', 'channel', channel) + local channel = meths.nvim_get_api_info()[1] + meths.nvim_set_var('channel', channel) end) describe('wait()', function() @@ -61,13 +61,13 @@ describe('wait()', function() -- XXX: flaky (#11137) helpers.retry(nil, nil, function() - nvim('set_var', 'counter', 0) + meths.nvim_set_var('counter', 0) eq(-1, call('wait', 20, 'Count() >= 5', 99999)) end) - nvim('set_var', 'counter', 0) + meths.nvim_set_var('counter', 0) eq(0, call('wait', 10000, 'Count() >= 5', 5)) - eq(5, nvim('get_var', 'counter')) + eq(5, meths.nvim_get_var('counter')) end) it('validates args', 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/wait_spec.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/functional/vimscript/wait_spec.lua') diff --git a/test/functional/vimscript/wait_spec.lua b/test/functional/vimscript/wait_spec.lua index e6b244538d..4ee3b183b3 100644 --- a/test/functional/vimscript/wait_spec.lua +++ b/test/functional/vimscript/wait_spec.lua @@ -7,14 +7,14 @@ local eq = helpers.eq local feed = helpers.feed local feed_command = helpers.feed_command local next_msg = helpers.next_msg -local meths = helpers.meths +local api = helpers.api local source = helpers.source local pcall_err = helpers.pcall_err before_each(function() clear() - local channel = meths.nvim_get_api_info()[1] - meths.nvim_set_var('channel', channel) + local channel = api.nvim_get_api_info()[1] + api.nvim_set_var('channel', channel) end) describe('wait()', function() @@ -61,13 +61,13 @@ describe('wait()', function() -- XXX: flaky (#11137) helpers.retry(nil, nil, function() - meths.nvim_set_var('counter', 0) + api.nvim_set_var('counter', 0) eq(-1, call('wait', 20, 'Count() >= 5', 99999)) end) - meths.nvim_set_var('counter', 0) + api.nvim_set_var('counter', 0) eq(0, call('wait', 10000, 'Count() >= 5', 5)) - eq(5, meths.nvim_get_var('counter')) + eq(5, api.nvim_get_var('counter')) end) it('validates args', function() -- cgit From 0185152802d4a84258a9a04c1d86a7e27d37d721 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 12 Feb 2024 05:50:39 -0800 Subject: refactor(tests): get channel id via nvim_get_chan_info #27441 Minor "best practices" nudge. --- test/functional/vimscript/wait_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/vimscript/wait_spec.lua') diff --git a/test/functional/vimscript/wait_spec.lua b/test/functional/vimscript/wait_spec.lua index 4ee3b183b3..50cdb2cfb4 100644 --- a/test/functional/vimscript/wait_spec.lua +++ b/test/functional/vimscript/wait_spec.lua @@ -13,7 +13,7 @@ local pcall_err = helpers.pcall_err before_each(function() clear() - local channel = api.nvim_get_api_info()[1] + local channel = api.nvim_get_chan_info(0).id api.nvim_set_var('channel', channel) end) -- cgit