aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui')
-rw-r--r--test/functional/ui/input_spec.lua70
-rw-r--r--test/functional/ui/screen.lua3
2 files changed, 72 insertions, 1 deletions
diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua
index 81af908045..a7c8e02def 100644
--- a/test/functional/ui/input_spec.lua
+++ b/test/functional/ui/input_spec.lua
@@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')
local clear, execute, nvim = helpers.clear, helpers.execute, helpers.nvim
local feed, next_message, eq = helpers.feed, helpers.next_message, helpers.eq
local expect = helpers.expect
+local Screen = require('test.functional.ui.screen')
describe('mappings', function()
local cid
@@ -40,7 +41,76 @@ describe('mappings', function()
end)
end)
+describe('feeding large chunks of input with <Paste>', function()
+ local screen
+ before_each(function()
+ clear()
+ screen = Screen.new()
+ screen:attach()
+ execute('set ruler')
+ end)
+
+ it('ok', function()
+ local t = {}
+ for i = 1, 20000 do
+ t[i] = 'item ' .. tostring(i)
+ end
+ feed('i<Paste>')
+ screen:expect([[
+ ^ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ -- INSERT (paste) -- |
+ ]])
+ feed(table.concat(t, '<Enter>'))
+ screen:expect([[
+ item 19988 |
+ item 19989 |
+ item 19990 |
+ item 19991 |
+ item 19992 |
+ item 19993 |
+ item 19994 |
+ item 19995 |
+ item 19996 |
+ item 19997 |
+ item 19998 |
+ item 19999 |
+ item 20000^ |
+ -- INSERT (paste) -- |
+ ]])
+ feed('<Paste>')
+ screen:expect([[
+ item 19988 |
+ item 19989 |
+ item 19990 |
+ item 19991 |
+ item 19992 |
+ item 19993 |
+ item 19994 |
+ item 19995 |
+ item 19996 |
+ item 19997 |
+ item 19998 |
+ item 19999 |
+ item 20000^ |
+ -- INSERT -- 20000,11 Bot |
+ ]])
+ end)
+end)
+
describe('input utf sequences that contain CSI/K_SPECIAL', function()
+ before_each(clear)
it('ok', function()
feed('i…<esc>')
expect('…')
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 08c4bfae0b..1be83d745e 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -163,6 +163,7 @@ function Screen.new(width, height)
height = 14
end
local self = setmetatable({
+ timeout = default_screen_timeout,
title = '',
icon = '',
bell = false,
@@ -248,7 +249,7 @@ function Screen:wait(check, timeout)
return true
end
- run(nil, notification_cb, nil, timeout or default_screen_timeout)
+ run(nil, notification_cb, nil, timeout or self.timeout)
if not checked then
err = check()
end