mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 06:16:08 +00:00
vim-patch:8.2.2030: some tests fail on Mac
Problem: Some tests fail on Mac.
Solution: Avoid Mac test failures. Add additional test for wildmenu.
(Yegappan Lakshmanan, closes vim/vim#7341)
4b2ce1297e
This commit is contained in:
@@ -114,6 +114,13 @@ if has('win32')
|
|||||||
let $PROMPT = '$P$G'
|
let $PROMPT = '$P$G'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if has('mac')
|
||||||
|
" In MacOS, when starting a shell in a terminal, a bash deprecation warning
|
||||||
|
" message is displayed. This breaks the terminal test. Disable the warning
|
||||||
|
" message.
|
||||||
|
let $BASH_SILENCE_DEPRECATION_WARNING = 1
|
||||||
|
endif
|
||||||
|
|
||||||
" Prepare for calling test_garbagecollect_now().
|
" Prepare for calling test_garbagecollect_now().
|
||||||
let v:testing = 1
|
let v:testing = 1
|
||||||
|
|
||||||
|
@@ -1809,6 +1809,36 @@ func Test_read_shellcmd()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Test for going up and down the directory tree using 'wildmenu'
|
||||||
|
func Test_wildmenu_dirstack()
|
||||||
|
CheckUnix
|
||||||
|
%bw!
|
||||||
|
call mkdir('Xdir1/dir2/dir3', 'p')
|
||||||
|
call writefile([], 'Xdir1/file1_1.txt')
|
||||||
|
call writefile([], 'Xdir1/file1_2.txt')
|
||||||
|
call writefile([], 'Xdir1/dir2/file2_1.txt')
|
||||||
|
call writefile([], 'Xdir1/dir2/file2_2.txt')
|
||||||
|
call writefile([], 'Xdir1/dir2/dir3/file3_1.txt')
|
||||||
|
call writefile([], 'Xdir1/dir2/dir3/file3_2.txt')
|
||||||
|
cd Xdir1/dir2/dir3
|
||||||
|
set wildmenu
|
||||||
|
|
||||||
|
call feedkeys(":e \<Tab>\<C-B>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"e file3_1.txt', @:)
|
||||||
|
call feedkeys(":e \<Tab>\<Up>\<C-B>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"e ../dir3/', @:)
|
||||||
|
call feedkeys(":e \<Tab>\<Up>\<Up>\<C-B>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"e ../../dir2/', @:)
|
||||||
|
call feedkeys(":e \<Tab>\<Up>\<Up>\<Down>\<C-B>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"e ../../dir2/dir3/', @:)
|
||||||
|
call feedkeys(":e \<Tab>\<Up>\<Up>\<Down>\<Down>\<C-B>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"e ../../dir2/dir3/file3_1.txt', @:)
|
||||||
|
|
||||||
|
cd -
|
||||||
|
call delete('Xdir1', 'rf')
|
||||||
|
set wildmenu&
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test for recalling newer or older cmdline from history with <Up>, <Down>,
|
" Test for recalling newer or older cmdline from history with <Up>, <Down>,
|
||||||
" <S-Up>, <S-Down>, <PageUp>, <PageDown>, <C-p>, or <C-n>.
|
" <S-Up>, <S-Down>, <PageUp>, <PageDown>, <C-p>, or <C-n>.
|
||||||
func Test_recalling_cmdline()
|
func Test_recalling_cmdline()
|
||||||
|
@@ -774,7 +774,13 @@ func Test_shell()
|
|||||||
CheckUnix
|
CheckUnix
|
||||||
let save_shell = &shell
|
let save_shell = &shell
|
||||||
set shell=
|
set shell=
|
||||||
call assert_fails('shell', 'E91:')
|
let caught_e91 = 0
|
||||||
|
try
|
||||||
|
shell
|
||||||
|
catch /E91:/
|
||||||
|
let caught_e91 = 1
|
||||||
|
endtry
|
||||||
|
call assert_equal(1, caught_e91)
|
||||||
let &shell = save_shell
|
let &shell = save_shell
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user