mirror of
https://github.com/neovim/neovim.git
synced 2025-11-04 09:44:31 +00:00
test: make some tests more stable (#16860)
This commit is contained in:
@@ -350,7 +350,7 @@ describe('on_lines does not emit out-of-bounds line indexes when', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('creating a terminal buffer #16394', function()
|
it('creating a terminal buffer #16394', function()
|
||||||
feed_command([[autocmd TermOpen * ++once call v:lua.register_callback(expand("<abuf>"))]])
|
feed_command('autocmd TermOpen * ++once call v:lua.register_callback(str2nr(expand("<abuf>")))')
|
||||||
feed_command('terminal')
|
feed_command('terminal')
|
||||||
sleep(500)
|
sleep(500)
|
||||||
eq('', exec_lua([[return _G.cb_error]]))
|
eq('', exec_lua([[return _G.cb_error]]))
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ local nvim_prog = helpers.nvim_prog
|
|||||||
local nvim_set = helpers.nvim_set
|
local nvim_set = helpers.nvim_set
|
||||||
local ok = helpers.ok
|
local ok = helpers.ok
|
||||||
local read_file = helpers.read_file
|
local read_file = helpers.read_file
|
||||||
local exec_lua = helpers.exec_lua
|
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
if helpers.pending_win32(pending) then return end
|
||||||
|
|
||||||
@@ -581,34 +580,21 @@ describe('TUI', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it("paste: 'nomodifiable' buffer", function()
|
it("paste: 'nomodifiable' buffer", function()
|
||||||
local has_luajit = exec_lua('return jit ~= nil')
|
|
||||||
child_session:request('nvim_command', 'set nomodifiable')
|
child_session:request('nvim_command', 'set nomodifiable')
|
||||||
child_session:request('nvim_exec_lua', [[
|
child_session:request('nvim_exec_lua', [[
|
||||||
-- Stack traces for this test are non-deterministic, so disable them
|
-- Truncate the error message to hide the line number
|
||||||
_G.debug.traceback = function(msg) return msg end
|
_G.debug.traceback = function(msg) return msg:sub(-49) end
|
||||||
]], {})
|
]], {})
|
||||||
feed_data('\027[200~fail 1\nfail 2\n\027[201~')
|
feed_data('\027[200~fail 1\nfail 2\n\027[201~')
|
||||||
if has_luajit then
|
screen:expect{grid=[[
|
||||||
screen:expect{grid=[[
|
|
|
||||||
|
|
{4:~ }|
|
||||||
{4:~ }|
|
{5: }|
|
||||||
{5: }|
|
{8:paste: Error executing lua: Vim:E21: Cannot make c}|
|
||||||
{8:paste: Error executing lua: vim.lua:0: Vim:E21: Ca}|
|
{8:hanges, 'modifiable' is off} |
|
||||||
{8:nnot make changes, 'modifiable' is off} |
|
{10:Press ENTER or type command to continue}{1: } |
|
||||||
{10:Press ENTER or type command to continue}{1: } |
|
{3:-- TERMINAL --} |
|
||||||
{3:-- TERMINAL --} |
|
]]}
|
||||||
]]}
|
|
||||||
else
|
|
||||||
screen:expect{grid=[[
|
|
||||||
|
|
|
||||||
{4:~ }|
|
|
||||||
{5: }|
|
|
||||||
{8:paste: Error executing lua: Vim:E21: Cannot make c}|
|
|
||||||
{8:hanges, 'modifiable' is off} |
|
|
||||||
{10:Press ENTER or type command to continue}{1: } |
|
|
||||||
{3:-- TERMINAL --} |
|
|
||||||
]]}
|
|
||||||
end
|
|
||||||
feed_data('\n') -- <Enter>
|
feed_data('\n') -- <Enter>
|
||||||
child_session:request('nvim_command', 'set modifiable')
|
child_session:request('nvim_command', 'set modifiable')
|
||||||
feed_data('\027[200~success 1\nsuccess 2\n\027[201~')
|
feed_data('\027[200~success 1\nsuccess 2\n\027[201~')
|
||||||
|
|||||||
Reference in New Issue
Block a user