aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/search_stat_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /test/functional/legacy/search_stat_spec.lua
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-aucmd_textputpost.tar.gz
rneovim-aucmd_textputpost.tar.bz2
rneovim-aucmd_textputpost.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/legacy/search_stat_spec.lua')
-rw-r--r--test/functional/legacy/search_stat_spec.lua64
1 files changed, 58 insertions, 6 deletions
diff --git a/test/functional/legacy/search_stat_spec.lua b/test/functional/legacy/search_stat_spec.lua
index 9fcf798836..bd5ab68e5c 100644
--- a/test/functional/legacy/search_stat_spec.lua
+++ b/test/functional/legacy/search_stat_spec.lua
@@ -1,7 +1,6 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, feed, exec, command = helpers.clear, helpers.feed, helpers.exec, helpers.command
-local poke_eventloop = helpers.poke_eventloop
describe('search stat', function()
local screen
@@ -11,8 +10,9 @@ describe('search stat', function()
screen:set_default_attr_ids({
[1] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
[2] = {background = Screen.colors.Yellow}, -- Search
- [3] = {foreground = Screen.colors.Blue4, background = Screen.colors.LightGrey}, -- Folded
+ [3] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey}, -- Folded
[4] = {reverse = true}, -- IncSearch, TabLineFill
+ [5] = {foreground = Screen.colors.Red}, -- WarningMsg
})
screen:attach()
end)
@@ -80,12 +80,11 @@ describe('search stat', function()
{1:~ }|
/foo [1/2] |
]])
+ -- Note: there is an intermediate state where the search stat disappears.
feed('n')
- poke_eventloop()
- screen:expect_unchanged()
+ screen:expect_unchanged(true)
feed('n')
- poke_eventloop()
- screen:expect_unchanged()
+ screen:expect_unchanged(true)
end)
-- oldtest: Test_search_stat_then_gd()
@@ -185,4 +184,57 @@ describe('search stat', function()
/abc^ |
]])
end)
+
+ -- oldtest: Test_search_stat_backwards()
+ it('when searching backwards', function()
+ screen:try_resize(60, 10)
+ exec([[
+ set shm-=S
+ call setline(1, ['test', ''])
+ ]])
+
+ feed('*')
+ screen:expect([[
+ {2:^test} |
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ /\<test\> [1/1] |
+ ]])
+
+ feed('N')
+ screen:expect([[
+ {2:^test} |
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ ?\<test\> [1/1] |
+ ]])
+
+ command('set shm+=S')
+ feed('N')
+ -- shows "Search Hit Bottom.."
+ screen:expect([[
+ {2:^test} |
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {5:search hit TOP, continuing at BOTTOM} |
+ ]])
+ end)
end)