aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/script_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-01-03 02:09:18 +0100
committerJustin M. Keyes <justinkz@gmail.com>2024-01-03 02:09:29 +0100
commit04f2f864e270e772c6326cefdf24947f0130e492 (patch)
tree46f83f909b888a66c741032ab955afc6eab84292 /test/functional/ex_cmds/script_spec.lua
parent59d117ec99b6037cb9fad5bbfb6d0b18f5012927 (diff)
downloadrneovim-04f2f864e270e772c6326cefdf24947f0130e492.tar.gz
rneovim-04f2f864e270e772c6326cefdf24947f0130e492.tar.bz2
rneovim-04f2f864e270e772c6326cefdf24947f0130e492.zip
refactor: format test/*
Diffstat (limited to 'test/functional/ex_cmds/script_spec.lua')
-rw-r--r--test/functional/ex_cmds/script_spec.lua39
1 files changed, 30 insertions, 9 deletions
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)