aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/command_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2022-03-27 10:25:55 -0700
committerGitHub <noreply@github.com>2022-03-27 10:25:55 -0700
commit72652cbc46f568128bfc296ba63fb2d26941da8e (patch)
tree45883e033228aacc55df313edb7acac1e1d76698 /test/functional/api/command_spec.lua
parent05edab85d7edad63c3b449689b57f9f658782c11 (diff)
downloadrneovim-72652cbc46f568128bfc296ba63fb2d26941da8e.tar.gz
rneovim-72652cbc46f568128bfc296ba63fb2d26941da8e.tar.bz2
rneovim-72652cbc46f568128bfc296ba63fb2d26941da8e.zip
feat(test): use nvim_exec in helpers.source() #16064
helpers.source() was a hack to work around the lack of anonymous :source. Its "create tempfile" behavior is not a required part of most tests that use it. Some tests still need the old "create tempfile" behavior either because they test SID behavior, or because of missing nvim_exec features: #16071
Diffstat (limited to 'test/functional/api/command_spec.lua')
-rw-r--r--test/functional/api/command_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/api/command_spec.lua b/test/functional/api/command_spec.lua
index b80004f67c..94176fc2ce 100644
--- a/test/functional/api/command_spec.lua
+++ b/test/functional/api/command_spec.lua
@@ -65,6 +65,7 @@ describe('nvim_get_commands', function()
local cmd3 = { addr=NIL, bang=false, bar=true, complete=NIL, complete_arg=NIL, count=NIL, definition='call \128\253R3_ohyeah()', name='Cmd3', nargs='0', range=NIL, register=false, keepscript=false, script_id=3, }
local cmd4 = { addr=NIL, bang=false, bar=false, complete=NIL, complete_arg=NIL, count=NIL, definition='call \128\253R4_just_great()', name='Cmd4', nargs='0', range=NIL, register=true, keepscript=false, script_id=4, }
source([[
+ let s:foo = 1
command -complete=custom,ListUsers -nargs=+ Finger !finger <args>
]])
eq({Finger=cmd1}, meths.get_commands({builtin=false}))
@@ -72,12 +73,18 @@ describe('nvim_get_commands', function()
eq({Finger=cmd1, TestCmd=cmd0}, meths.get_commands({builtin=false}))
source([[
+ function! s:foo() abort
+ endfunction
command -bang -nargs=* Cmd2 call <SID>foo(<q-args>)
]])
source([[
+ function! s:ohyeah() abort
+ endfunction
command -bar -nargs=0 Cmd3 call <SID>ohyeah()
]])
source([[
+ function! s:just_great() abort
+ endfunction
command -register Cmd4 call <SID>just_great()
]])
-- TODO(justinmk): Order is stable but undefined. Sort before return?