vim-patch:8.2.0211: test for ANSI colors fails without an "ls" command

Problem:    Test for ANSI colors fails without an "ls" command.
Solution:   Use "dir". (Ken Takata, closes vim/vim#5582)

94255df057

Cherry-pick test_functions.vim change from patch 8.2.0186.
This commit is contained in:
zeertzjq 2022-10-26 08:57:59 +08:00
parent 3c5b435801
commit 0aaef07224

View File

@ -2128,7 +2128,7 @@ func Test_range()
" settagstack() " settagstack()
call settagstack(1, #{items : range(4)}) call settagstack(1, #{items : range(4)})
" sign_define() " sign_define()
call assert_fails("call sign_define(range(5))", "E715:") call assert_fails("call sign_define(range(5))", "E715:")
call assert_fails("call sign_placelist(range(5))", "E715:") call assert_fails("call sign_placelist(range(5))", "E715:")
@ -2161,12 +2161,17 @@ func Test_range()
set tagfunc=TagFunc set tagfunc=TagFunc
call assert_fails("call taglist('asdf')", 'E987:') call assert_fails("call taglist('asdf')", 'E987:')
set tagfunc= set tagfunc=
" term_start() " term_start()
if has('terminal') if has('terminal') && has('termguicolors')
call assert_fails('call term_start(range(3, 4))', 'E474:') call assert_fails('call term_start(range(3, 4))', 'E474:')
let g:terminal_ansi_colors = range(16) let g:terminal_ansi_colors = range(16)
call assert_fails('call term_start("ls", #{term_finish: "close"})', 'E475:') if has('win32')
let cmd = "cmd /c dir"
else
let cmd = "ls"
endif
call assert_fails('call term_start("' .. cmd .. '", #{term_finish: "close"})', 'E475:')
unlet g:terminal_ansi_colors unlet g:terminal_ansi_colors
endif endif