put_spec.lua 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. local n = require('test.functional.testnvim')()
  2. local Screen = require('test.functional.ui.screen')
  3. local clear = n.clear
  4. local source = n.source
  5. describe('put', function()
  6. before_each(clear)
  7. -- oldtest: Test_put_other_window()
  8. it('above topline in buffer in two splits', function()
  9. local screen = Screen.new(80, 10)
  10. source([[
  11. 40vsplit
  12. 0put ='some text at the top'
  13. put =' one more text'
  14. put =' two more text'
  15. put =' three more text'
  16. put =' four more text'
  17. ]])
  18. screen:expect([[
  19. some text at the top │some text at the top |
  20. one more text │ one more text |
  21. two more text │ two more text |
  22. three more text │ three more text |
  23. ^four more text │ four more text |
  24. │ |
  25. {1:~ }│{1:~ }|*2
  26. {3:[No Name] [+] }{2:[No Name] [+] }|
  27. |
  28. ]])
  29. end)
  30. -- oldtest: Test_put_in_last_displayed_line()
  31. it('in last displayed line', function()
  32. local screen = Screen.new(75, 10)
  33. source([[
  34. autocmd CursorMoved * eval line('w$')
  35. let @a = 'x'->repeat(&columns * 2 - 2)
  36. eval range(&lines)->setline(1)
  37. call feedkeys('G"ap')
  38. ]])
  39. screen:expect([[
  40. 2 |
  41. 3 |
  42. 4 |
  43. 5 |
  44. 6 |
  45. 7 |
  46. 8 |
  47. 9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
  48. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx^x |
  49. |
  50. ]])
  51. end)
  52. end)