diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-02-04 09:31:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-04 01:31:37 +0000 |
commit | 3d22293496fc0b8781c3530e8f6a270f1647be93 (patch) | |
tree | 498a1365fd8a2fe71c6d02d82ae9ac470e520ea0 /test/functional/vimscript/getchar_spec.lua | |
parent | 40edfb0af0d71c12636a2aaf5c382e1b4daec9cd (diff) | |
download | rneovim-3d22293496fc0b8781c3530e8f6a270f1647be93.tar.gz rneovim-3d22293496fc0b8781c3530e8f6a270f1647be93.tar.bz2 rneovim-3d22293496fc0b8781c3530e8f6a270f1647be93.zip |
test(getchar_spec): fix flakiness (#32320)
Problem: getchar_spec may fail when screen:expect_unchanged() doesn't
wait long enough.
Solution: Add poke_eventloop() before screen:expect_unchanged().
Diffstat (limited to 'test/functional/vimscript/getchar_spec.lua')
-rw-r--r-- | test/functional/vimscript/getchar_spec.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/functional/vimscript/getchar_spec.lua b/test/functional/vimscript/getchar_spec.lua index 1327d741cf..4ecf082f97 100644 --- a/test/functional/vimscript/getchar_spec.lua +++ b/test/functional/vimscript/getchar_spec.lua @@ -5,6 +5,7 @@ local clear = n.clear local exec = n.exec local feed = n.feed local async_command = n.async_meths.nvim_command +local poke_eventloop = n.poke_eventloop describe('getchar()', function() before_each(clear) @@ -56,8 +57,10 @@ describe('getchar()', function() "echo 1234 | sleep 1m | call getchar(-1, #{cursor: 'keep'})", }) do async_command(cmd) + poke_eventloop() screen:expect_unchanged() feed('a') + poke_eventloop() screen:expect_unchanged() end |