aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/search_stat_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-02-15 07:26:55 +0800
committerGitHub <noreply@github.com>2023-02-15 07:26:55 +0800
commit05faa8f30ad770d4e4ead41cec601ccced8fb97f (patch)
tree23680deec8f90b7159c23f19f0a7a042ac1941f7 /test/functional/legacy/search_stat_spec.lua
parent556f8646c01d1751cf39fe4df9c622899dceab9d (diff)
downloadrneovim-05faa8f30ad770d4e4ead41cec601ccced8fb97f.tar.gz
rneovim-05faa8f30ad770d4e4ead41cec601ccced8fb97f.tar.bz2
rneovim-05faa8f30ad770d4e4ead41cec601ccced8fb97f.zip
test: make expect_unchanged() less confusing (#22255)
Problem: The sleep before collecting the initial screen state is confusing and may lead to unexpected success if it comes after a blocking RPC call. Solution: Remove that sleep and add an "intermediate" argument.
Diffstat (limited to 'test/functional/legacy/search_stat_spec.lua')
-rw-r--r--test/functional/legacy/search_stat_spec.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/test/functional/legacy/search_stat_spec.lua b/test/functional/legacy/search_stat_spec.lua
index 9fcf798836..06e0b2320a 100644
--- a/test/functional/legacy/search_stat_spec.lua
+++ b/test/functional/legacy/search_stat_spec.lua
@@ -1,7 +1,6 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, feed, exec, command = helpers.clear, helpers.feed, helpers.exec, helpers.command
-local poke_eventloop = helpers.poke_eventloop
describe('search stat', function()
local screen
@@ -80,12 +79,11 @@ describe('search stat', function()
{1:~ }|
/foo [1/2] |
]])
+ -- Note: there is an intermediate state where the search stat disappears.
feed('n')
- poke_eventloop()
- screen:expect_unchanged()
+ screen:expect_unchanged(true)
feed('n')
- poke_eventloop()
- screen:expect_unchanged()
+ screen:expect_unchanged(true)
end)
-- oldtest: Test_search_stat_then_gd()