display_spec.lua 738 B

1234567891011121314151617181920212223242526272829303132
  1. local helpers = require('test.functional.helpers')(after_each)
  2. local Screen = require('test.functional.ui.screen')
  3. local clear = helpers.clear
  4. local poke_eventloop = helpers.poke_eventloop
  5. local feed = helpers.feed
  6. local feed_command = helpers.feed_command
  7. describe('display', function()
  8. local screen
  9. it('scroll when modified at topline', function()
  10. clear()
  11. screen = Screen.new(20, 4)
  12. screen:attach()
  13. screen:set_default_attr_ids({
  14. [1] = {bold = true},
  15. })
  16. feed_command([[call setline(1, repeat('a', 21))]])
  17. poke_eventloop()
  18. feed('O')
  19. screen:expect([[
  20. ^ |
  21. aaaaaaaaaaaaaaaaaaaa|
  22. a |
  23. {1:-- INSERT --} |
  24. ]])
  25. end)
  26. end)