mirror of
https://github.com/neovim/neovim.git
synced 2024-12-25 21:55:17 -07:00
052498ed42
Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
43 lines
992 B
Lua
43 lines
992 B
Lua
local t = require('test.testutil')
|
|
local n = require('test.functional.testnvim')()
|
|
|
|
local clear = n.clear
|
|
local write_file = t.write_file
|
|
local command = n.command
|
|
local feed = n.feed
|
|
local api = n.api
|
|
local eq = t.eq
|
|
|
|
before_each(clear)
|
|
|
|
-- oldtest: Test_autocmd_invalidates_undo_on_textchanged()
|
|
it('no E440 in quickfix window when autocommand invalidates undo', function()
|
|
write_file(
|
|
'XTest_autocmd_invalidates_undo_on_textchanged',
|
|
[[
|
|
set hidden
|
|
" create quickfix list (at least 2 lines to move line)
|
|
vimgrep /u/j %
|
|
|
|
" enter quickfix window
|
|
cwindow
|
|
|
|
" set modifiable
|
|
setlocal modifiable
|
|
|
|
" set autocmd to clear quickfix list
|
|
|
|
autocmd! TextChanged <buffer> call setqflist([])
|
|
" move line
|
|
move+1
|
|
]]
|
|
)
|
|
finally(function()
|
|
os.remove('XTest_autocmd_invalidates_undo_on_textchanged')
|
|
end)
|
|
command('edit XTest_autocmd_invalidates_undo_on_textchanged')
|
|
command('so %')
|
|
feed('G')
|
|
eq('', api.nvim_get_vvar('errmsg'))
|
|
end)
|