aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/lua/ui_event_spec.lua3
-rw-r--r--test/functional/ui/decorations_spec.lua54
-rw-r--r--test/functional/ui/float_spec.lua8
-rw-r--r--test/functional/ui/fold_spec.lua4
-rw-r--r--test/functional/ui/inccommand_spec.lua11
-rw-r--r--test/functional/ui/options_spec.lua9
-rw-r--r--test/functional/ui/searchhl_spec.lua2
7 files changed, 55 insertions, 36 deletions
diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua
index de436771f9..373d45da61 100644
--- a/test/functional/lua/ui_event_spec.lua
+++ b/test/functional/lua/ui_event_spec.lua
@@ -77,8 +77,7 @@ describe('vim.ui_attach', function()
}
feed '<c-y>'
- -- There is an intermediate state where the 'showmode' message disappears.
- screen:expect_unchanged(true)
+ screen:expect_unchanged()
expect_events {
{ "popupmenu_hide" };
}
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index 2c4bcadc4b..df7de77333 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -1775,30 +1775,36 @@ describe('extmark decorations', function()
]])
-- When only one highlight group has an underline attribute, it should always take effect.
- meths.buf_clear_namespace(0, ns, 0, -1)
- meths.buf_set_extmark(0, ns, 0, 0, { end_col = 9, hl_group = 'TestUL', priority = 20 })
- meths.buf_set_extmark(0, ns, 0, 3, { end_col = 6, hl_group = 'TestBold', priority = 30 })
- screen:expect([[
- {1:aaa}{5:bbb}{1:aa^a} |
- {0:~ }|
- |
- ]])
- meths.buf_clear_namespace(0, ns, 0, -1)
- meths.buf_set_extmark(0, ns, 0, 0, { end_col = 9, hl_group = 'TestUL', priority = 30 })
- meths.buf_set_extmark(0, ns, 0, 3, { end_col = 6, hl_group = 'TestBold', priority = 20 })
- screen:expect_unchanged(true)
- meths.buf_clear_namespace(0, ns, 0, -1)
- meths.buf_set_extmark(0, ns, 0, 0, { end_col = 9, hl_group = 'TestUC', priority = 20 })
- meths.buf_set_extmark(0, ns, 0, 3, { end_col = 6, hl_group = 'TestBold', priority = 30 })
- screen:expect([[
- {2:aaa}{6:bbb}{2:aa^a} |
- {0:~ }|
- |
- ]])
- meths.buf_clear_namespace(0, ns, 0, -1)
- meths.buf_set_extmark(0, ns, 0, 0, { end_col = 9, hl_group = 'TestUC', priority = 30 })
- meths.buf_set_extmark(0, ns, 0, 3, { end_col = 6, hl_group = 'TestBold', priority = 20 })
- screen:expect_unchanged(true)
+ for _, d in ipairs({-5, 5}) do
+ meths.buf_clear_namespace(0, ns, 0, -1)
+ screen:expect([[
+ aaabbbaa^a |
+ {0:~ }|
+ |
+ ]])
+ meths.buf_set_extmark(0, ns, 0, 0, { end_col = 9, hl_group = 'TestUL', priority = 25 + d })
+ meths.buf_set_extmark(0, ns, 0, 3, { end_col = 6, hl_group = 'TestBold', priority = 25 - d })
+ screen:expect([[
+ {1:aaa}{5:bbb}{1:aa^a} |
+ {0:~ }|
+ |
+ ]])
+ end
+ for _, d in ipairs({-5, 5}) do
+ meths.buf_clear_namespace(0, ns, 0, -1)
+ screen:expect([[
+ aaabbbaa^a |
+ {0:~ }|
+ |
+ ]])
+ meths.buf_set_extmark(0, ns, 0, 0, { end_col = 9, hl_group = 'TestUC', priority = 25 + d })
+ meths.buf_set_extmark(0, ns, 0, 3, { end_col = 6, hl_group = 'TestBold', priority = 25 - d })
+ screen:expect([[
+ {2:aaa}{6:bbb}{2:aa^a} |
+ {0:~ }|
+ |
+ ]])
+ end
end)
it('highlight is combined with syntax and sign linehl #20004', function()
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index 400b2bbae7..9f6b3ca296 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -9284,9 +9284,11 @@ describe('float window', function()
end
-- Also test with global NormalNC highlight
- meths.set_option_value('winhighlight', '', {win = win})
- command('hi link NormalNC Visual')
- screen:expect_unchanged(true)
+ exec_lua([[
+ vim.api.nvim_set_option_value('winhighlight', '', {win = ...})
+ vim.api.nvim_set_hl(0, 'NormalNC', {link = 'Visual'})
+ ]], win)
+ screen:expect_unchanged()
command('hi clear NormalNC')
command('hi SpecialRegion guifg=Red blend=0')
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua
index 7894c8296b..264c0355ae 100644
--- a/test/functional/ui/fold_spec.lua
+++ b/test/functional/ui/fold_spec.lua
@@ -169,10 +169,10 @@ describe("folded lines", function()
end
-- CursorLine is applied correctly with screenrow motions #22232
feed("jgk")
- screen:expect_unchanged(true)
+ screen:expect_unchanged()
-- CursorLine is applied correctly when closing a fold when cursor is not at fold start
feed("zo4Gzc")
- screen:expect_unchanged(true)
+ screen:expect_unchanged()
command("set cursorlineopt=line")
if multigrid then
screen:expect([[
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index 00dfa3fd49..cb00c75e74 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -2929,7 +2929,16 @@ it(':substitute with inccommand, allows :redraw before first separator is typed
meths.open_win(float_buf, false, {
relative = 'editor', height = 1, width = 5, row = 3, col = 0, focusable = false,
})
- feed(':%s')
+ feed(':')
+ screen:expect([[
+ foo bar baz |
+ bar baz fox |
+ bar foo baz |
+ {16: }{15: }|
+ {15:~ }|
+ :^ |
+ ]])
+ feed('%s')
screen:expect([[
foo bar baz |
bar baz fox |
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
index 58cd68d94a..f3817856f7 100644
--- a/test/functional/ui/options_spec.lua
+++ b/test/functional/ui/options_spec.lua
@@ -69,15 +69,18 @@ describe('UI receives option updates', function()
eq({'mouse_on'}, evs)
end)
command("set mouse=")
+ screen:expect(function()
+ eq({'mouse_on', 'mouse_off'}, evs)
+ end)
command("set mouse&")
screen:expect(function()
- eq({'mouse_on','mouse_off', 'mouse_on'}, evs)
+ eq({'mouse_on', 'mouse_off', 'mouse_on'}, evs)
end)
screen:detach()
- eq({'mouse_on','mouse_off', 'mouse_on'}, evs)
+ eq({'mouse_on', 'mouse_off', 'mouse_on'}, evs)
screen:attach()
screen:expect(function()
- eq({'mouse_on','mouse_off','mouse_on', 'mouse_on'}, evs)
+ eq({'mouse_on', 'mouse_off', 'mouse_on', 'mouse_on'}, evs)
end)
end)
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index 7fd66d6f8a..eb7a2574f3 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -337,7 +337,7 @@ describe('search highlighting', function()
]])
feed('/foo')
helpers.poke_eventloop()
- screen:sleep(0)
+ screen:sleep(100)
screen:expect_unchanged()
end)