2015-11-05 13:34:48 -07:00
|
|
|
-- Specs for :wundo and underlying functions
|
2014-10-26 13:03:02 -07:00
|
|
|
|
2016-04-23 16:53:11 -07:00
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
2017-04-08 14:12:26 -07:00
|
|
|
local command, clear, eval, spawn, nvim_prog, set_session =
|
|
|
|
helpers.command, helpers.clear, helpers.eval, helpers.spawn,
|
2015-11-05 13:34:48 -07:00
|
|
|
helpers.nvim_prog, helpers.set_session
|
2014-10-26 13:03:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
describe(':wundo', function()
|
|
|
|
before_each(clear)
|
2017-04-08 14:12:26 -07:00
|
|
|
after_each(function()
|
|
|
|
os.remove(eval('getcwd()') .. '/foo')
|
|
|
|
end)
|
2014-10-26 13:03:02 -07:00
|
|
|
|
|
|
|
it('safely fails on new, non-empty buffer', function()
|
2017-04-08 14:12:26 -07:00
|
|
|
command('normal! iabc')
|
|
|
|
command('wundo foo') -- This should not segfault. #1027
|
2014-10-26 13:03:02 -07:00
|
|
|
--TODO: check messages for error message
|
|
|
|
end)
|
2015-11-05 13:34:48 -07:00
|
|
|
end)
|
2014-10-26 13:03:02 -07:00
|
|
|
|
2015-11-05 13:34:48 -07:00
|
|
|
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)
|
2017-04-08 14:12:26 -07:00
|
|
|
command('echo "True"') -- Should not error out due to crashed Neovim
|
2016-04-13 05:21:32 -07:00
|
|
|
session:close()
|
2015-11-05 13:34:48 -07:00
|
|
|
end)
|
2014-10-26 13:03:02 -07:00
|
|
|
end)
|