From 8fc93241d680f7c73e3013d679adb70c09cb3d57 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 24 Jul 2019 02:50:24 +0200 Subject: tests: fix/improve Screen:expect_unchanged (#10577) Do not sleep before collecting initial state. Ref: https://github.com/neovim/neovim/pull/10550#issuecomment-513670205 --- test/functional/ui/screen.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/functional/ui/screen.lua') diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index c067cca048..81a15cada2 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -450,12 +450,12 @@ end function Screen:expect_unchanged(waittime_ms, ignore_attrs, request_cb) waittime_ms = waittime_ms and waittime_ms or 100 -- Collect the current screen state. - self:sleep(waittime_ms, request_cb) + self:sleep(0, request_cb) local kwargs = self:get_snapshot(nil, ignore_attrs) - -- Wait for potential changes. - self:sleep(waittime_ms, request_cb) + + -- Check that screen state does not change. kwargs.unchanged = true - -- Check that screen state did not change. + kwargs.timeout = waittime_ms self:expect(kwargs) end -- cgit