2015-11-05 13:34:48 -07:00
|
|
|
-- Specs for :wundo and underlying functions
|
2014-10-26 13:03:02 -07:00
|
|
|
|
|
|
|
local helpers = require('test.functional.helpers')
|
2015-11-05 13:34:48 -07:00
|
|
|
local execute, clear, eval, feed, spawn, nvim_prog, set_session =
|
|
|
|
helpers.execute, helpers.clear, helpers.eval, helpers.feed, helpers.spawn,
|
|
|
|
helpers.nvim_prog, helpers.set_session
|
2014-10-26 13:03:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
describe(':wundo', function()
|
|
|
|
before_each(clear)
|
|
|
|
|
|
|
|
it('safely fails on new, non-empty buffer', function()
|
|
|
|
feed('iabc<esc>')
|
|
|
|
execute('wundo foo') -- This should not segfault. #1027
|
|
|
|
--TODO: check messages for error message
|
|
|
|
|
|
|
|
os.remove(eval('getcwd()') .. '/foo') --cleanup
|
|
|
|
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)
|
|
|
|
execute('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)
|