aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/source_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-03-26 10:49:32 +0800
committerGitHub <noreply@github.com>2023-03-26 10:49:32 +0800
commit4863ca6b8902c5b0aab95f2af640118cd417d379 (patch)
tree41a1ecb32984dc88f25df722abaf3ba381db3cf3 /test/functional/ex_cmds/source_spec.lua
parent4eef5ac453866dae7c03f5432fc8c4dfcda19f54 (diff)
downloadrneovim-4863ca6b8902c5b0aab95f2af640118cd417d379.tar.gz
rneovim-4863ca6b8902c5b0aab95f2af640118cd417d379.tar.bz2
rneovim-4863ca6b8902c5b0aab95f2af640118cd417d379.zip
test: use exec_capture() in more places (#22787)
Problem: Using `meths.exec2("code", { output = true })` is too verbose. Solution: Use exec_capture() in more places.
Diffstat (limited to 'test/functional/ex_cmds/source_spec.lua')
-rw-r--r--test/functional/ex_cmds/source_spec.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/functional/ex_cmds/source_spec.lua b/test/functional/ex_cmds/source_spec.lua
index e12ead240d..41045f5cb4 100644
--- a/test/functional/ex_cmds/source_spec.lua
+++ b/test/functional/ex_cmds/source_spec.lua
@@ -96,12 +96,12 @@ describe(':source', function()
let d = s:s]])
command('source')
- eq('2', meths.exec2('echo a', { output = true }).output)
- eq("{'k': 'v'}", meths.exec2('echo b', { output = true }).output)
+ eq('2', exec_capture('echo a'))
+ eq("{'k': 'v'}", exec_capture('echo b'))
-- Script items are created only on script var access
- eq("1", meths.exec2('echo c', { output = true }).output)
- eq("0zBEEFCAFE", meths.exec2('echo d', { output = true }).output)
+ eq("1", exec_capture('echo c'))
+ eq("0zBEEFCAFE", exec_capture('echo d'))
exec('set cpoptions+=C')
eq('Vim(let):E723: Missing end of Dictionary \'}\': ', exc_exec('source'))
@@ -124,14 +124,14 @@ describe(':source', function()
-- Source the 2nd line only
feed('ggjV')
feed_command(':source')
- eq('3', meths.exec2('echo a', { output = true }).output)
+ eq('3', exec_capture('echo a'))
-- Source from 2nd line to end of file
feed('ggjVG')
feed_command(':source')
- eq('4', meths.exec2('echo a', { output = true }).output)
- eq("{'K': 'V'}", meths.exec2('echo b', { output = true }).output)
- eq("<SNR>1_C()", meths.exec2('echo D()', { output = true }).output)
+ eq('4', exec_capture('echo a'))
+ eq("{'K': 'V'}", exec_capture('echo b'))
+ eq("<SNR>1_C()", exec_capture('echo D()'))
-- Source last line only
feed_command(':$source')
@@ -147,7 +147,7 @@ describe(':source', function()
let a = 123
]]
command('source')
- eq('123', meths.exec2('echo a', { output = true }).output)
+ eq('123', exec_capture('echo a'))
end)
it('multiline heredoc command', function()
@@ -157,7 +157,7 @@ describe(':source', function()
EOF]])
command('source')
- eq('4', meths.exec2('echo luaeval("y")', { output = true }).output)
+ eq('4', exec_capture('echo luaeval("y")'))
end)
it('can source lua files', function()