highlight_spec.lua 673 B

1234567891011121314151617181920212223242526
  1. local helpers = require('test.functional.helpers')(after_each)
  2. local exec_lua = helpers.exec_lua
  3. local eq = helpers.eq
  4. local eval = helpers.eval
  5. local command = helpers.command
  6. local clear = helpers.clear
  7. describe('vim.highlight.on_yank', function()
  8. before_each(function()
  9. clear()
  10. end)
  11. it('does not show errors even if buffer is wiped before timeout', function()
  12. command('new')
  13. exec_lua[[
  14. vim.highlight.on_yank({timeout = 10, on_macro = true, event = {operator = "y", regtype = "v"}})
  15. vim.cmd('bwipeout!')
  16. ]]
  17. helpers.sleep(10)
  18. helpers.feed('<cr>') -- avoid hang if error message exists
  19. eq('', eval('v:errmsg'))
  20. end)
  21. end)