aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-10-26 11:24:51 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-10-26 11:24:51 -0300
commit29d64a901df6eff436b100374b2a240eea1906d9 (patch)
tree613b820fdc3d1d48a68146a4b516d05898798513 /test/functional
parent424b00ea610b90ed4041711f27d71d0e359038a7 (diff)
parent1726c7d999e68b4ed8aee234b7dfa339ed0784b2 (diff)
downloadrneovim-29d64a901df6eff436b100374b2a240eea1906d9.tar.gz
rneovim-29d64a901df6eff436b100374b2a240eea1906d9.tar.bz2
rneovim-29d64a901df6eff436b100374b2a240eea1906d9.zip
Merge PR #3413 'Refactor Neovim to remove the side effects of `K_EVENT`'
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/api/vim_spec.lua18
-rw-r--r--test/functional/terminal/tui_spec.lua47
2 files changed, 49 insertions, 16 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 8d4e183653..eb4804f141 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -247,33 +247,21 @@ describe('vim_* functions', function()
~ |
{1:very fail} |
]])
+ helpers.wait()
-- shows up to &cmdheight lines
- nvim_async('err_write', 'more fail\n')
- nvim_async('err_write', 'too fail\n')
+ nvim_async('err_write', 'more fail\ntoo fail\n')
screen:expect([[
~ |
~ |
~ |
~ |
~ |
- {1:very fail} |
- {1:more fail} |
- {2:Press ENTER or type command to continue}^ |
- ]])
-
- -- shows the rest after return
- feed('<cr>')
- screen:expect([[
- ~ |
- ~ |
- ~ |
- {1:very fail} |
{1:more fail} |
- {2:Press ENTER or type command to continue} |
{1:too fail} |
{2:Press ENTER or type command to continue}^ |
]])
+ feed('<cr>') -- exit the press ENTER screen
end)
end)
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index 5ec087645f..d38bedcd4a 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -12,7 +12,9 @@ describe('tui', function()
before_each(function()
helpers.clear()
screen = thelpers.screen_setup(0, '["'..helpers.nvim_prog..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]')
- screen.timeout = 30000 -- pasting can be really slow in the TUI
+ -- right now pasting can be really slow in the TUI, especially in ASAN.
+ -- this will be fixed later but for now we require a high timeout.
+ screen.timeout = 60000
screen:expect([[
{1: } |
~ |
@@ -51,6 +53,49 @@ describe('tui', function()
]])
end)
+ it('interprets leading esc byte as the alt modifier', function()
+ local keys = 'dfghjkl'
+ for c in keys:gmatch('.') do
+ execute('nnoremap <a-'..c..'> ialt-'..c..'<cr><esc>')
+ feed('\x1b'..c)
+ end
+ screen:expect([[
+ alt-j |
+ alt-k |
+ alt-l |
+ {1: } |
+ [No Name] [+] |
+ |
+ -- TERMINAL -- |
+ ]])
+ feed('gg')
+ screen:expect([[
+ {1:a}lt-d |
+ alt-f |
+ alt-g |
+ alt-h |
+ [No Name] [+] |
+ |
+ -- TERMINAL -- |
+ ]])
+ end)
+
+ it('accepts ascii control sequences', function()
+ feed('i')
+ feed('\x16\x07') -- ctrl+g
+ feed('\x16\x16') -- ctrl+v
+ feed('\x16\x0d') -- ctrl+m
+ screen:expect([[
+ {3:^G^V^M}{1: } |
+ ~ |
+ ~ |
+ ~ |
+ [No Name] [+] |
+ -- INSERT -- |
+ -- TERMINAL -- |
+ ]], {[1] = {reverse = true}, [2] = {background = 11}, [3] = {foreground = 4}})
+ end)
+
it('automatically sends <Paste> for bracketed paste sequences', function()
feed('i\x1b[200~')
screen:expect([[