diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2022-08-03 00:08:17 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2022-08-03 00:08:17 -0600 |
commit | 9449e1b8d273ff78eb894c588110ffa0c17d6ee3 (patch) | |
tree | 9e4470c33bd4187d9f42f0b2c4aaa995310c5be8 /test/functional/terminal | |
parent | 308e1940dcd64aa6c344c403d4f9e0dda58d9c5c (diff) | |
parent | b8dcbcc732baf84fc48d6b272c3ade0bcb129b3b (diff) | |
download | rneovim-9449e1b8d273ff78eb894c588110ffa0c17d6ee3.tar.gz rneovim-9449e1b8d273ff78eb894c588110ffa0c17d6ee3.tar.bz2 rneovim-9449e1b8d273ff78eb894c588110ffa0c17d6ee3.zip |
Merge remote-tracking branch 'upstream/master' into rahm
Diffstat (limited to 'test/functional/terminal')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 49 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 12 |
2 files changed, 56 insertions, 5 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 1cef771f0d..23430a620b 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -5,12 +5,15 @@ local feed, clear, nvim = helpers.feed, helpers.clear, helpers.nvim local poke_eventloop = helpers.poke_eventloop local eval, feed_command, source = helpers.eval, helpers.feed_command, helpers.source local eq, neq = helpers.eq, helpers.neq +local meths = helpers.meths +local retry = helpers.retry local write_file = helpers.write_file local command = helpers.command local exc_exec = helpers.exc_exec local matches = helpers.matches local exec_lua = helpers.exec_lua local sleep = helpers.sleep +local funcs = helpers.funcs describe(':terminal buffer', function() local screen @@ -298,6 +301,44 @@ describe(':terminal buffer', function() feed_command('put a') -- register a is empty helpers.assert_alive() end) + + it([[can use temporary normal mode <c-\><c-o>]], function() + eq('t', funcs.mode(1)) + feed [[<c-\><c-o>]] + screen:expect{grid=[[ + tty ready | + {2:^ } | + | + | + | + | + {3:-- (terminal) --} | + ]]} + eq('ntT', funcs.mode(1)) + + feed [[:let g:x = 17]] + screen:expect{grid=[[ + tty ready | + {2: } | + | + | + | + | + :let g:x = 17^ | + ]]} + + feed [[<cr>]] + screen:expect{grid=[[ + tty ready | + {1: } | + | + | + | + | + {3:-- TERMINAL --} | + ]]} + eq('t', funcs.mode(1)) + end) end) describe('No heap-buffer-overflow when using', function() @@ -364,3 +405,11 @@ describe('on_lines does not emit out-of-bounds line indexes when', function() eq('', exec_lua([[return _G.cb_error]])) end) end) + +it('terminal truncates number of composing characters to 5', function() + clear() + local chan = meths.open_term(0, {}) + local composing = ('a̳'):sub(2) + meths.chan_send(chan, 'a' .. composing:rep(8)) + retry(nil, nil, function() eq('a' .. composing:rep(5), meths.get_current_line()) end) +end) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index dd88379344..eee759d2be 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -144,10 +144,9 @@ describe('TUI', function() {3:-- TERMINAL --} | ]]} - -- TODO(bfredl): messes up the output (just like vim does). feed_data('g') screen:expect{grid=[[ - ) | + :call ManyErr() | {8:Error detected while processing function ManyErr:} | {11:line 2:} | {10:-- More --}{1: } | @@ -156,7 +155,7 @@ describe('TUI', function() screen:try_resize(50,10) screen:expect{grid=[[ - ) | + :call ManyErr() | {8:Error detected while processing function ManyErr:} | {11:line 2:} | {8:FAIL 0} | @@ -436,8 +435,11 @@ describe('TUI', function() | {3:-- TERMINAL --} | ]]) - feed_data(':tab split\r:tabnew\r') - feed_data(':highlight Tabline ctermbg=NONE ctermfg=NONE cterm=underline\r') + child_session:request('nvim_command', [[ + tab split + tabnew + highlight Tabline ctermbg=NONE ctermfg=NONE cterm=underline + ]]) local attrs = screen:get_default_attr_ids() attrs[11] = {underline = true} screen:expect([[ |