mirror of
https://github.com/neovim/neovim.git
synced 2025-09-09 12:58:16 +00:00
paste: fixup tests
This commit is contained in:
@@ -96,7 +96,7 @@ end
|
||||
-- Default paste function.
|
||||
local function _paste(data)
|
||||
-- local eof = (data == {''})
|
||||
local curline = vim.api.nvim_call_function('line', {'.'}) - 1
|
||||
local curline = vim.api.nvim_call_function('line', {'.'})
|
||||
vim.api.nvim_buf_set_lines(
|
||||
0,
|
||||
curline,
|
||||
|
@@ -146,8 +146,7 @@ describe('TUI', function()
|
||||
]], attrs)
|
||||
end)
|
||||
|
||||
it('bracketed Paste', function()
|
||||
-- Pasting can be really slow in the TUI, specially in ASAN.
|
||||
it('paste: Insert mode', function()
|
||||
feed_data('i\027[200~')
|
||||
screen:expect([[
|
||||
{1: } |
|
||||
@@ -160,8 +159,8 @@ describe('TUI', function()
|
||||
]])
|
||||
feed_data('pasted from terminal')
|
||||
screen:expect([[
|
||||
pasted from terminal{1: } |
|
||||
|
|
||||
pasted from terminal{1: } |
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{5:[No Name] [+] }|
|
||||
@@ -171,8 +170,8 @@ describe('TUI', function()
|
||||
feed_data('\027[201~') -- End paste.
|
||||
feed_data('\027\000') -- ESC: go to Normal mode.
|
||||
screen:expect([[
|
||||
pasted from termina{1:l} |
|
||||
|
|
||||
pasted from termina{1:l} |
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{5:[No Name] [+] }|
|
||||
@@ -181,24 +180,20 @@ describe('TUI', function()
|
||||
]])
|
||||
end)
|
||||
|
||||
it('handles pasting a specific amount of text', function()
|
||||
-- Need extra time for this test, specially in ASAN.
|
||||
screen.timeout = 60000
|
||||
it('pasting a specific amount of text #10311', function()
|
||||
feed_data('i\027[200~'..string.rep('z', 64)..'\027[201~')
|
||||
screen:expect([[
|
||||
|
|
||||
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz|
|
||||
zzzzzzzzzzzzzz{1: } |
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{5:[No Name] [+] }|
|
||||
{3:-- INSERT --} |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
end)
|
||||
|
||||
it('can handle arbitrarily long bursts of input', function()
|
||||
-- Need extra time for this test, specially in ASAN.
|
||||
screen.timeout = 60000
|
||||
it('big burst of input (bracketed paste)', function()
|
||||
feed_command('set ruler')
|
||||
local t = {}
|
||||
for i = 1, 3000 do
|
||||
|
Reference in New Issue
Block a user