neovim/test/functional/ex_cmds/wundo_spec.lua
ZyX 65fb622000 functests: Replace execute with either command or feed_command
Hope this will make people using feed_command less likely: this hides bugs.
Already found at least two:

1. msgpackparse() will show internal error: hash_add() in case of duplicate
   keys, though it will still work correctly. Currently silenced.
2. ttimeoutlen was spelled incorrectly, resulting in option not being set when
   expected. Test was still functioning somehow though. Currently fixed.
2017-04-09 03:24:08 +03:00

31 lines
964 B
Lua

-- Specs for :wundo and underlying functions
local helpers = require('test.functional.helpers')(after_each)
local command, clear, eval, spawn, nvim_prog, set_session =
helpers.command, helpers.clear, helpers.eval, helpers.spawn,
helpers.nvim_prog, helpers.set_session
describe(':wundo', function()
before_each(clear)
after_each(function()
os.remove(eval('getcwd()') .. '/foo')
end)
it('safely fails on new, non-empty buffer', function()
command('normal! iabc')
command('wundo foo') -- This should not segfault. #1027
--TODO: check messages for error message
end)
end)
describe('u_* functions', function()
it('safely fail on new, non-empty buffer', function()
local session = spawn({nvim_prog, '-u', 'NONE', '-i', 'NONE', '--embed',
'-c', 'set undodir=. undofile'})
set_session(session)
command('echo "True"') -- Should not error out due to crashed Neovim
session:close()
end)
end)