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

View File

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