diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-25 13:35:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 13:35:24 +0800 |
commit | b72dc2d8ade54ba22b0b25ffe9402ffb314ef97d (patch) | |
tree | 1528216536dbf48d27e62857efecf9de30941757 /test/functional/ui/screen.lua | |
parent | 2e1f5055acdef650c27efc4afdf8606037ec021b (diff) | |
download | rneovim-b72dc2d8ade54ba22b0b25ffe9402ffb314ef97d.tar.gz rneovim-b72dc2d8ade54ba22b0b25ffe9402ffb314ef97d.tar.bz2 rneovim-b72dc2d8ade54ba22b0b25ffe9402ffb314ef97d.zip |
test: don't use minimal timeout for "intermediate" flag (#27620)
With "intermediate" flag, only using minimal timeout is too short and
may lead to failures.
Also remove the fallback timeout in screen:expect_unchanged(), as having
a different fallback timeout than screen:expect() is confusing.
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r-- | test/functional/ui/screen.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 3043a3c60a..e8d7d5c72d 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -638,7 +638,6 @@ screen:redraw_debug() to show all intermediate screen states.]] end function Screen:expect_unchanged(intermediate, waittime_ms, ignore_attrs) - waittime_ms = waittime_ms and waittime_ms or 100 -- Collect the current screen state. local kwargs = self:get_snapshot(nil, ignore_attrs) @@ -689,8 +688,8 @@ function Screen:_wait(check, flags) -- For an "unchanged" test, flags.timeout is the time during which the state -- must not change, so always wait this full time. - if (flags.unchanged or flags.intermediate) and flags.timeout then - minimal_timeout = timeout + if flags.unchanged then + minimal_timeout = flags.timeout or default_timeout_factor * 20 end assert(timeout >= minimal_timeout) @@ -711,12 +710,12 @@ function Screen:_wait(check, flags) intermediate_seen = true end - if not err then + if not err and (not flags.intermediate or intermediate_seen) then success_seen = true if did_minimal_timeout then self._session:stop() end - elseif success_seen and #args > 0 then + elseif err and success_seen and #args > 0 then success_seen = false failure_after_success = true -- print(inspect(args)) |