diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-07-23 12:46:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-23 12:46:56 +0800 |
commit | ce56ad2ba7c93c5053b657cd99642b375a944607 (patch) | |
tree | 3d077ead2b71c8f64ec2c9fee56541aa27d09d98 /test/functional/terminal/ex_terminal_spec.lua | |
parent | f56c1848091bb64c63b5bc25ec74bcbd2f52bdde (diff) | |
download | rneovim-ce56ad2ba7c93c5053b657cd99642b375a944607.tar.gz rneovim-ce56ad2ba7c93c5053b657cd99642b375a944607.tar.bz2 rneovim-ce56ad2ba7c93c5053b657cd99642b375a944607.zip |
test: reduce flakiness (#24443)
Avoid consecutive RPC requests involving :startinsert or :stopinsert,
because consecutive RPC requests may be processed together, before the
:startinsert or :stopinsert takes effect.
Also change some feed_command() to command() to make tests faster.
Diffstat (limited to 'test/functional/terminal/ex_terminal_spec.lua')
-rw-r--r-- | test/functional/terminal/ex_terminal_spec.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua index 28751a3504..5204b61f57 100644 --- a/test/functional/terminal/ex_terminal_spec.lua +++ b/test/functional/terminal/ex_terminal_spec.lua @@ -99,7 +99,7 @@ describe(':terminal', function() end) it('nvim_get_mode() in :terminal', function() - command(':terminal') + command('terminal') eq({ blocking=false, mode='nt' }, nvim('get_mode')) feed('i') eq({ blocking=false, mode='t' }, nvim('get_mode')) @@ -108,17 +108,19 @@ describe(':terminal', function() end) it(':stopinsert RPC request exits terminal-mode #7807', function() - command(':terminal') + command('terminal') feed('i[tui] insert-mode') eq({ blocking=false, mode='t' }, nvim('get_mode')) command('stopinsert') + feed('<Ignore>') -- Add input to separate two RPC requests eq({ blocking=false, mode='nt' }, nvim('get_mode')) end) it(':stopinsert in normal mode doesn\'t break insert mode #9889', function() - command(':terminal') + command('terminal') eq({ blocking=false, mode='nt' }, nvim('get_mode')) - command(':stopinsert') + command('stopinsert') + feed('<Ignore>') -- Add input to separate two RPC requests eq({ blocking=false, mode='nt' }, nvim('get_mode')) feed('a') eq({ blocking=false, mode='t' }, nvim('get_mode')) |