patch 9.0.0149: test for fuzzy completion fails sometimes

Problem:    Test for fuzzy completion fails sometimes.
Solution:   Use a more specific file name to minimize the chance of matching a
            random directory name. (closes #10854)
This commit is contained in:
Bram Moolenaar
2022-08-06 10:28:19 +01:00
parent 3ec3b8e92d
commit 5ac4b1a24e
2 changed files with 12 additions and 9 deletions

View File

@ -2423,17 +2423,18 @@ endfunc
" buffer name fuzzy completion " buffer name fuzzy completion
func Test_fuzzy_completion_bufname() func Test_fuzzy_completion_bufname()
set wildoptions& set wildoptions&
edit SomeFile.txt " Use a long name to reduce the risk of matching a random directory name
edit SomeRandomFileWithLetters.txt
enew enew
call feedkeys(":b SF\<Tab>\<C-B>\"\<CR>", 'tx') call feedkeys(":b SRFWL\<Tab>\<C-B>\"\<CR>", 'tx')
call assert_equal('"b SF', @:) call assert_equal('"b SRFWL', @:)
call feedkeys(":b S*File.txt\<Tab>\<C-B>\"\<CR>", 'tx') call feedkeys(":b S*FileWithLetters.txt\<Tab>\<C-B>\"\<CR>", 'tx')
call assert_equal('"b SomeFile.txt', @:) call assert_equal('"b SomeRandomFileWithLetters.txt', @:)
set wildoptions=fuzzy set wildoptions=fuzzy
call feedkeys(":b SF\<Tab>\<C-B>\"\<CR>", 'tx') call feedkeys(":b SRFWL\<Tab>\<C-B>\"\<CR>", 'tx')
call assert_equal('"b SomeFile.txt', @:) call assert_equal('"b SomeRandomFileWithLetters.txt', @:)
call feedkeys(":b S*File.txt\<Tab>\<C-B>\"\<CR>", 'tx') call feedkeys(":b S*FileWithLetters.txt\<Tab>\<C-B>\"\<CR>", 'tx')
call assert_equal('"b S*File.txt', @:) call assert_equal('"b S*FileWithLetters.txt', @:)
%bw! %bw!
set wildoptions& set wildoptions&
endfunc endfunc

View File

@ -735,6 +735,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 */
/**/
149,
/**/ /**/
148, 148,
/**/ /**/