aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/ui/screen.lua3
-rw-r--r--test/functional/ui/screen_basic_spec.lua47
2 files changed, 49 insertions, 1 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 6c1a1788ce..ebe8af35eb 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -374,7 +374,8 @@ function Screen:_handle_mouse_off()
end
function Screen:_handle_mode_change(mode)
- assert(mode == 'insert' or mode == 'replace' or mode == 'normal')
+ assert(mode == 'insert' or mode == 'replace'
+ or mode == 'normal' or mode == 'cmdline')
self.mode = mode
end
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua
index 593b6dd763..d03f98c26f 100644
--- a/test/functional/ui/screen_basic_spec.lua
+++ b/test/functional/ui/screen_basic_spec.lua
@@ -642,5 +642,52 @@ describe('Screen', function()
eq("normal", screen.mode)
end)
end)
+
+ it('works in cmdline mode', function()
+ feed(':')
+ screen:expect([[
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ :^ |
+ ]],nil,nil,function ()
+ eq("cmdline", screen.mode)
+ end)
+
+ feed('<esc>/')
+ screen:expect([[
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ /^ |
+ ]],nil,nil,function ()
+ eq("cmdline", screen.mode)
+ end)
+
+
+ feed('<esc>?')
+ screen:expect([[
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ?^ |
+ ]],nil,nil,function ()
+ eq("cmdline", screen.mode)
+ end)
+
+ feed('<esc>')
+ screen:expect([[
+ ^ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]],nil,nil,function ()
+ eq("normal", screen.mode)
+ end)
+ end)
end)
end)