0
0
mirror of https://github.com/vim/vim.git synced 2025-10-21 08:24:06 -04:00

patch 9.1.1744: tests: Test_skip_wildtrigger_hist_navigation() may fail

Problem:  tests: Test_skip_wildtrigger_hist_navigation() may fail
          (zeertzjq).
Solution: Correct test to validate intended behavior (Girish Palya).

See https://github.com/vim/vim/pull/18219#issuecomment-3265183318

closes: #18243

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Girish Palya
2025-09-08 15:47:25 -04:00
committed by Christian Brabandt
parent d8ae381786
commit 3980c86525
2 changed files with 18 additions and 11 deletions

View File

@@ -5062,25 +5062,30 @@ endfunc
" Skip wildmenu during history navigation via Up/Down keys
func Test_skip_wildtrigger_hist_navigation()
call test_override("char_avail", 1)
cnoremap <F8> <C-R>=wildtrigger()[-1]<CR>
set wildmenu
call feedkeys(":ech\<F8>\<F4>\<C-B>\"\<CR>", "tx")
call assert_match('echo*', g:Sline)
call assert_equal('"echo', @:)
set wildmenu wildmode=noselect,full
augroup TestSkipWildtrigger | autocmd!
autocmd CmdlineChanged : call wildtrigger()
augroup END
cnoremap <expr> <Up> wildmenumode() ? "\<C-E>\<Up>" : "\<Up>"
cnoremap <expr> <Down> wildmenumode() ? "\<C-E>\<Down>" : "\<Down>"
call feedkeys(":echom \"foo\"", "tx")
call feedkeys(":echom \"foobar\"", "tx")
call feedkeys(":ech\<F8>\<C-E>\<UP>\<C-B>\"\<CR>", "tx")
call feedkeys(":ech\<Up>\<C-B>\"\<CR>", "tx")
call assert_equal('"echom "foobar"', @:)
call feedkeys(":ech\<F8>\<C-E>\<UP>\<UP>\<UP>\<C-B>\"\<CR>", "tx")
call feedkeys(":ech\<Up>\<Up>\<C-B>\"\<CR>", "tx")
call assert_equal('"echom "foo"', @:)
call feedkeys(":ech\<F8>\<C-E>\<UP>\<UP>\<UP>\<Down>\<C-B>\"\<CR>", "tx")
call feedkeys(":ech\<Up>\<Up>\<Down>\<C-B>\"\<CR>", "tx")
call assert_equal('"echom "foobar"', @:)
call feedkeys(":ech\<Up>\<Up>\<Down>\<Down>\<C-B>\"\<CR>", "tx")
call assert_equal('"ech', @:)
call test_override("char_avail", 0)
set wildmenu&
cunmap <F8>
set wildmenu& wildmode& wildoptions&
augroup TestSkipWildtrigger | autocmd! | augroup END
cunmap <Up>
cunmap <Down>
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -724,6 +724,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1744,
/**/
1743,
/**/