aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-05-22 17:51:31 +0200
committerGitHub <noreply@github.com>2022-05-22 17:51:31 +0200
commitb863c150c91a3621cdeb2efae54a4f0fe3328c09 (patch)
tree93fc98d7209365cd24e0437c940bd6c369abba54
parent63741176ce9bf576ee9693b93844e1cbcf0420b2 (diff)
parente01c197eab682b1995222299b6a77cf2c1f54610 (diff)
downloadrneovim-b863c150c91a3621cdeb2efae54a4f0fe3328c09.tar.gz
rneovim-b863c150c91a3621cdeb2efae54a4f0fe3328c09.tar.bz2
rneovim-b863c150c91a3621cdeb2efae54a4f0fe3328c09.zip
Merge pull request #18696 from bfredl/quickinc
fix(tests): fix some issues with ui/inccommand_spec.lua causing slowness
-rw-r--r--test/functional/ui/inccommand_spec.lua24
1 files changed, 14 insertions, 10 deletions
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index 879c44773a..fb80444430 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -123,13 +123,11 @@ describe(":substitute, inccommand=split interactivity", function()
it("no preview if invoked by feedkeys()", function()
-- in a script...
source([[:call feedkeys(":%s/tw/MO/g\<CR>")]])
- poke_eventloop()
-- or interactively...
- feed([[:call feedkeys(":%s/tw/MO/g\<CR>")<CR>]])
- poke_eventloop()
+ feed([[:call feedkeys(":%s/bs/BUU/g\<lt>CR>")<CR>]])
eq(1, eval("bufnr('$')"))
-- sanity check: assert the buffer state
- expect(default_text:gsub("tw", "MO"))
+ expect(default_text:gsub("tw", "MO"):gsub("bs", "BUU"))
end)
end)
@@ -381,7 +379,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
}
local function test_sub(substring, split, redoable)
- clear()
+ command('bwipe!')
feed_command("set inccommand=" .. split)
insert("1")
@@ -407,7 +405,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
end
local function test_notsub(substring, split, redoable)
- clear()
+ command('bwipe!')
feed_command("set inccommand=" .. split)
insert("1")
@@ -441,7 +439,7 @@ describe(":substitute, 'inccommand' preserves undo", function()
local function test_threetree(substring, split)
- clear()
+ command('bwipe!')
feed_command("set inccommand=" .. split)
insert("1")
@@ -493,6 +491,8 @@ describe(":substitute, 'inccommand' preserves undo", function()
2]])
end
+ before_each(clear)
+
it("at a non-leaf of the undo tree", function()
for _, case in pairs(cases) do
for _, str in pairs(substrings) do
@@ -1646,10 +1646,12 @@ end)
describe("'inccommand' and :cnoremap", function()
local cases = { "", "split", "nosplit" }
+ local screen
- local function refresh(case)
+ local function refresh(case, visual)
clear()
- common_setup(nil, case, default_text)
+ screen = visual and Screen.new(50,10) or nil
+ common_setup(screen, case, default_text)
end
it('work with remapped characters', function()
@@ -1706,10 +1708,12 @@ describe("'inccommand' and :cnoremap", function()
it('still works with a broken mapping', function()
for _, case in pairs(cases) do
- refresh(case)
+ refresh(case, true)
feed_command("cnoremap <expr> x execute('bwipeout!')[-1].'x'")
feed(":%s/tw/tox<enter>")
+ screen:expect{any=[[{14:^E523:]]}
+ feed('<c-c>')
-- error thrown b/c of the mapping
neq(nil, eval('v:errmsg'):find('^E523:'))