wundo_spec.lua 871 B

123456789101112131415161718192021222324252627282930313233343536
  1. -- Specs for :wundo and underlying functions
  2. local n = require('test.functional.testnvim')()
  3. local command = n.command
  4. local clear = n.clear
  5. local eval = n.eval
  6. local set_session = n.set_session
  7. describe(':wundo', function()
  8. before_each(clear)
  9. after_each(function()
  10. os.remove(eval('getcwd()') .. '/foo')
  11. end)
  12. it('safely fails on new, non-empty buffer', function()
  13. command('normal! iabc')
  14. command('wundo foo') -- This should not segfault. #1027
  15. --TODO: check messages for error message
  16. end)
  17. end)
  18. describe('u_* functions', function()
  19. it('safely fail on new, non-empty buffer', function()
  20. local session = n.new_session(false, {
  21. args = {
  22. '-c',
  23. 'set undodir=. undofile',
  24. },
  25. })
  26. set_session(session)
  27. command('echo "True"') -- Should not error out due to crashed Neovim
  28. session:close()
  29. end)
  30. end)