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/buffer_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/buffer_spec.lua')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 9b690bed74..888d123b17 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -24,8 +24,7 @@ describe(':terminal buffer', function() before_each(function() clear() - feed_command('set modifiable swapfile undolevels=20') - poke_eventloop() + command('set modifiable swapfile undolevels=20') screen = thelpers.screen_setup() end) @@ -199,7 +198,6 @@ describe(':terminal buffer', function() it('handles loss of focus gracefully', function() -- Change the statusline to avoid printing the file name, which varies. nvim('set_option_value', 'statusline', '==========', {}) - feed_command('set laststatus=0') -- Save the buffer number of the terminal for later testing. local tbuf = eval('bufnr("%")') @@ -232,8 +230,6 @@ describe(':terminal buffer', function() neq(tbuf, eval('bufnr("%")')) feed_command('quit!') -- Should exit the new window, not the terminal. eq(tbuf, eval('bufnr("%")')) - - feed_command('set laststatus=1') -- Restore laststatus to the default. end) it('term_close() use-after-free #4393', function() @@ -433,7 +429,7 @@ describe('terminal input', function() _G.input_data = _G.input_data .. data end }) ]]) - command('startinsert') + feed('i') poke_eventloop() end) |