mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 09:44:31 +00:00 
			
		
		
		
	tests: fix/improve Screen:expect_unchanged (#10577)
Do not sleep before collecting initial state. Ref: https://github.com/neovim/neovim/pull/10550#issuecomment-513670205
This commit is contained in:
		@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -158,6 +158,7 @@ describe('search highlighting', function()
 | 
			
		||||
      bar foo baz
 | 
			
		||||
    ]])
 | 
			
		||||
    feed('/foo')
 | 
			
		||||
    helpers.wait()
 | 
			
		||||
    screen:expect_unchanged()
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user