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/ex_cmds/script_spec.lua | 39 +++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'test/functional/ex_cmds/script_spec.lua') diff --git a/test/functional/ex_cmds/script_spec.lua b/test/functional/ex_cmds/script_spec.lua index 62249caa5e..465397169a 100644 --- a/test/functional/ex_cmds/script_spec.lua +++ b/test/functional/ex_cmds/script_spec.lua @@ -17,7 +17,7 @@ before_each(clear) local function source(code) write_file(tmpfile, code) - command('source '..tmpfile) + command('source ' .. tmpfile) end describe('script_get-based command', function() @@ -30,29 +30,48 @@ describe('script_get-based command', function() local function test_garbage_exec(cmd, check_neq) describe(cmd, function() it('works correctly when skipping oneline variant', function() - eq(true, pcall(source, (dedent([[ + eq( + true, + pcall( + source, + (dedent([[ if 0 %s %s endif - ]])):format(cmd, garbage))) + ]])):format(cmd, garbage) + ) + ) eq('', exec_capture('messages')) if check_neq then - neq(0, exc_exec(dedent([[ + neq( + 0, + exc_exec(dedent([[ %s %s - ]])):format(cmd, garbage)) + ]])):format(cmd, garbage) + ) end end) it('works correctly when skipping HEREdoc variant', function() - eq(true, pcall(source, (dedent([[ + eq( + true, + pcall( + source, + (dedent([[ if 0 %s << EOF %s EOF endif - ]])):format(cmd, garbage))) + ]])):format(cmd, garbage) + ) + ) eq('', exec_capture('messages')) if check_neq then - eq(true, pcall(source, (dedent([[ + eq( + true, + pcall( + source, + (dedent([[ let g:exc = 0 try %s << EOF @@ -61,7 +80,9 @@ describe('script_get-based command', function() catch let g:exc = v:exception endtry - ]])):format(cmd, garbage))) + ]])):format(cmd, garbage) + ) + ) neq(0, meths.get_var('exc')) end end) -- cgit From c30f2e3182e3b50e7c03932027ac55edfc8ada4a Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 12:44:54 +0000 Subject: test: typing for helpers.meths --- test/functional/ex_cmds/script_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/ex_cmds/script_spec.lua') diff --git a/test/functional/ex_cmds/script_spec.lua b/test/functional/ex_cmds/script_spec.lua index 465397169a..20fd65fc69 100644 --- a/test/functional/ex_cmds/script_spec.lua +++ b/test/functional/ex_cmds/script_spec.lua @@ -83,7 +83,7 @@ describe('script_get-based command', function() ]])):format(cmd, garbage) ) ) - neq(0, meths.get_var('exc')) + neq(0, meths.nvim_get_var('exc')) end end) end) -- 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/ex_cmds/script_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/ex_cmds/script_spec.lua') diff --git a/test/functional/ex_cmds/script_spec.lua b/test/functional/ex_cmds/script_spec.lua index 20fd65fc69..ebdaa0f656 100644 --- a/test/functional/ex_cmds/script_spec.lua +++ b/test/functional/ex_cmds/script_spec.lua @@ -5,7 +5,7 @@ local neq = helpers.neq local command = helpers.command local exec_capture = helpers.exec_capture local write_file = helpers.write_file -local meths = helpers.meths +local api = helpers.api local clear = helpers.clear local dedent = helpers.dedent local exc_exec = helpers.exc_exec @@ -83,7 +83,7 @@ describe('script_get-based command', function() ]])):format(cmd, garbage) ) ) - neq(0, meths.nvim_get_var('exc')) + neq(0, api.nvim_get_var('exc')) end end) end) -- cgit From eb5d15e3838f53e2fcd25989c88db87458e9f984 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 7 Jan 2024 13:05:03 +0100 Subject: refactor: rewrite python provider in lua --- test/functional/ex_cmds/script_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/ex_cmds/script_spec.lua') diff --git a/test/functional/ex_cmds/script_spec.lua b/test/functional/ex_cmds/script_spec.lua index ebdaa0f656..4c963c5da7 100644 --- a/test/functional/ex_cmds/script_spec.lua +++ b/test/functional/ex_cmds/script_spec.lua @@ -96,7 +96,7 @@ describe('script_get-based command', function() -- Provider-based scripts test_garbage_exec('ruby', not missing_provider('ruby')) - test_garbage_exec('python3', not missing_provider('python3')) + test_garbage_exec('python3', not missing_provider('python')) -- Missing scripts test_garbage_exec('python', false) -- cgit