spell_spec.lua 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. -- Test for scenarios involving 'spell'
  2. local helpers = require('test.functional.helpers')(after_each)
  3. local Screen = require('test.functional.ui.screen')
  4. local clear = helpers.clear
  5. local feed = helpers.feed
  6. local feed_command = helpers.feed_command
  7. local insert = helpers.insert
  8. describe("'spell'", function()
  9. local screen
  10. before_each(function()
  11. clear()
  12. screen = Screen.new(80, 8)
  13. screen:attach()
  14. screen:set_default_attr_ids( {
  15. [0] = {bold=true, foreground=Screen.colors.Blue},
  16. [1] = {special = Screen.colors.Red, undercurl = true}
  17. })
  18. end)
  19. after_each(function()
  20. screen:detach()
  21. end)
  22. it('joins long lines #7937', function()
  23. feed_command('set spell')
  24. insert([[
  25. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
  26. tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  27. quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  28. consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
  29. cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
  30. non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  31. ]])
  32. feed('ggJJJJJJ0')
  33. screen:expect([[
  34. {1:^Lorem} {1:ipsum} dolor sit {1:amet}, {1:consectetur} {1:adipiscing} {1:elit}, {1:sed} do {1:eiusmod} {1:tempor} {1:i}|
  35. {1:ncididunt} {1:ut} {1:labore} {1:et} {1:dolore} {1:magna} {1:aliqua}. {1:Ut} {1:enim} ad minim {1:veniam}, {1:quis} {1:nostru}|
  36. {1:d} {1:exercitation} {1:ullamco} {1:laboris} {1:nisi} {1:ut} {1:aliquip} ex ea {1:commodo} {1:consequat}. {1:Duis} {1:aut}|
  37. {1:e} {1:irure} dolor in {1:reprehenderit} in {1:voluptate} {1:velit} {1:esse} {1:cillum} {1:dolore} {1:eu} {1:fugiat} {1:n}|
  38. {1:ulla} {1:pariatur}. {1:Excepteur} {1:sint} {1:occaecat} {1:cupidatat} non {1:proident}, {1:sunt} in culpa {1:qui}|
  39. {1:officia} {1:deserunt} {1:mollit} {1:anim} id est {1:laborum}. |
  40. {0:~ }|
  41. |
  42. ]])
  43. end)
  44. end)