aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/source_spec.lua
diff options
context:
space:
mode:
authorEvgeni Chasnovski <evgeni.chasnovski@gmail.com>2023-03-25 18:58:48 +0200
committerGitHub <noreply@github.com>2023-03-25 09:58:48 -0700
commitfe9cbcb3a5c82932ecfb8f49d07e98a1fc2b31e5 (patch)
treeb2828838c29b0a30befd703cf49a8d6cd16b89a0 /test/functional/ex_cmds/source_spec.lua
parent257d894d75bc583bb16f4dbe441907eb273d20ad (diff)
downloadrneovim-fe9cbcb3a5c82932ecfb8f49d07e98a1fc2b31e5.tar.gz
rneovim-fe9cbcb3a5c82932ecfb8f49d07e98a1fc2b31e5.tar.bz2
rneovim-fe9cbcb3a5c82932ecfb8f49d07e98a1fc2b31e5.zip
feat(api): nvim_exec2(), deprecate nvim_exec() #19032
Problem: The signature of nvim_exec() is not extensible per ":help api-contract". Solution: Introduce nvim_exec2() and deprecate nvim_exec().
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 64c3464be7..e12ead240d 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.exec('echo a', true))
- eq("{'k': 'v'}", meths.exec('echo b', true))
+ eq('2', meths.exec2('echo a', { output = true }).output)
+ eq("{'k': 'v'}", meths.exec2('echo b', { output = true }).output)
-- Script items are created only on script var access
- eq("1", meths.exec('echo c', true))
- eq("0zBEEFCAFE", meths.exec('echo d', true))
+ eq("1", meths.exec2('echo c', { output = true }).output)
+ eq("0zBEEFCAFE", meths.exec2('echo d', { output = true }).output)
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.exec('echo a', true))
+ eq('3', meths.exec2('echo a', { output = true }).output)
-- Source from 2nd line to end of file
feed('ggjVG')
feed_command(':source')
- eq('4', meths.exec('echo a', true))
- eq("{'K': 'V'}", meths.exec('echo b', true))
- eq("<SNR>1_C()", meths.exec('echo D()', true))
+ 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)
-- Source last line only
feed_command(':$source')
@@ -147,7 +147,7 @@ describe(':source', function()
let a = 123
]]
command('source')
- eq('123', meths.exec('echo a', true))
+ eq('123', meths.exec2('echo a', { output = true }).output)
end)
it('multiline heredoc command', function()
@@ -157,7 +157,7 @@ describe(':source', function()
EOF]])
command('source')
- eq('4', meths.exec('echo luaeval("y")', true))
+ eq('4', meths.exec2('echo luaeval("y")', { output = true }).output)
end)
it('can source lua files', function()