aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/cmdline_spec.lua
diff options
context:
space:
mode:
authorDongdong Zhou <dzhou121@gmail.com>2017-06-26 11:19:40 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2017-10-26 09:35:13 +0200
commit461ae698242458bffbf5fb68de89fe8b2a3defd2 (patch)
tree7f6172159e428b28d63c820fa9a3c0272393b884 /test/functional/ui/cmdline_spec.lua
parent866dadaf753ba3733feb8c22d7da47af757bd35c (diff)
downloadrneovim-461ae698242458bffbf5fb68de89fe8b2a3defd2.tar.gz
rneovim-461ae698242458bffbf5fb68de89fe8b2a3defd2.tar.bz2
rneovim-461ae698242458bffbf5fb68de89fe8b2a3defd2.zip
ext_cmdline: Add function block support
Diffstat (limited to 'test/functional/ui/cmdline_spec.lua')
-rw-r--r--test/functional/ui/cmdline_spec.lua39
1 files changed, 38 insertions, 1 deletions
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index 479d40e959..9e2857bc95 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -7,7 +7,7 @@ if helpers.pending_win32(pending) then return end
describe('External command line completion', function()
local screen
local shown = false
- local firstc, prompt, content, pos, char, shift, level, current_hide_level
+ local firstc, prompt, content, pos, char, shift, level, current_hide_level, in_function
before_each(function()
clear()
@@ -24,6 +24,10 @@ describe('External command line completion', function()
char, shift = unpack(data)
elseif name == "cmdline_pos" then
pos = data[1]
+ elseif name == "cmdline_function_show" then
+ in_function = true
+ elseif name == "cmdline_function_hide" then
+ in_function = false
end
end)
end)
@@ -158,6 +162,39 @@ describe('External command line completion', function()
eq(1, current_hide_level)
end)
+ feed(':function Foo()<cr>')
+ screen:expect([[
+ ^ |
+ ~ |
+ ~ |
+ ~ |
+ |
+ ]], nil, nil, function()
+ eq(true, in_function)
+ end)
+
+ feed('line1<cr>')
+ screen:expect([[
+ ^ |
+ ~ |
+ ~ |
+ ~ |
+ |
+ ]], nil, nil, function()
+ eq(true, in_function)
+ end)
+
+ feed('endfunction<cr>')
+ screen:expect([[
+ ^ |
+ ~ |
+ ~ |
+ ~ |
+ |
+ ]], nil, nil, function()
+ eq(false, in_function)
+ end)
+
end)
end)
end)