Skip to content

Conversation

@tompng
Copy link
Member

@tompng tompng commented Mar 20, 2024

This pull request is a PoC of rendering test with virtual screen.

assert_readmultiline(expected: '1.itself', prompt: '>', termination_proc: ->*{true}) do |io|
  io.write '1.ab'
  assert_equal ['>1.ab', ' 1.abs', ' 1.abs2'], io.current_screen
  io.write "\e"
  io.wait 0.49999999999
  assert_equal ['>1.ab', ' 1.abs', ' 1.abs2'], io.current_screen
  io.wait 0.00000000002
  assert_equal ['>1.ab'], io.current_screen
  io.write "\C-h\C-h\C-h.itself"
  io.close
end

Since we introduced differential rendering in #614, LineEditor now have a cache of what LineEditor rendered to the screen. In other words, LineEditor now have a virtual screen internally. We can use it for testing.

We still need yamatanooroti, but we can reduce using it to make CI faster.

Key actor test: use this virtual screen test
Test of render_differential correctly rendered to terminal: use yamatanooroti
Test some edge cases, Test rendering through multiple readmultiline: use yamatanooroti

TODO: specify terminal window size

@tompng
Copy link
Member Author

tompng commented Oct 3, 2024

Rendering test will be faster with #747

@tompng tompng closed this Oct 3, 2024
@tompng tompng deleted the virtual_screen_test branch October 3, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant