mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.1.1634: terminal test fails when term_getansicolors() is missing
Problem: Terminal test fails when term_getansicolors() is missing. Diff test fails without +rightleft. (Dominique Pelle) Solution: Check if term_getansicolors() is supported. (closes #4597)
This commit is contained in:
@@ -909,6 +909,9 @@ func Test_diff_of_diff()
|
|||||||
if !CanRunVimInTerminal()
|
if !CanRunVimInTerminal()
|
||||||
throw 'Skipped: cannot run Vim in a terminal window'
|
throw 'Skipped: cannot run Vim in a terminal window'
|
||||||
endif
|
endif
|
||||||
|
if !has("rightleft")
|
||||||
|
throw 'Skipped: rightleft not supported'
|
||||||
|
endif
|
||||||
|
|
||||||
call writefile([
|
call writefile([
|
||||||
\ 'call setline(1, ["aa","bb","cc","@@ -3,2 +5,7 @@","dd","ee","ff"])',
|
\ 'call setline(1, ["aa","bb","cc","@@ -3,2 +5,7 @@","dd","ee","ff"])',
|
||||||
|
@@ -1434,6 +1434,9 @@ func Test_terminal_api_call_fail_delete()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_terminal_ansicolors_default()
|
func Test_terminal_ansicolors_default()
|
||||||
|
if !exists('*term_getansicolors')
|
||||||
|
throw 'Skipped: term_getansicolors() not supported'
|
||||||
|
endif
|
||||||
let colors = [
|
let colors = [
|
||||||
\ '#000000', '#e00000',
|
\ '#000000', '#e00000',
|
||||||
\ '#00e000', '#e0e000',
|
\ '#00e000', '#e0e000',
|
||||||
@@ -1465,6 +1468,9 @@ let s:test_colors = [
|
|||||||
\]
|
\]
|
||||||
|
|
||||||
func Test_terminal_ansicolors_global()
|
func Test_terminal_ansicolors_global()
|
||||||
|
if !exists('*term_getansicolors')
|
||||||
|
throw 'Skipped: term_getansicolors() not supported'
|
||||||
|
endif
|
||||||
let g:terminal_ansi_colors = reverse(copy(s:test_colors))
|
let g:terminal_ansi_colors = reverse(copy(s:test_colors))
|
||||||
let buf = Run_shell_in_terminal({})
|
let buf = Run_shell_in_terminal({})
|
||||||
call assert_equal(g:terminal_ansi_colors, term_getansicolors(buf))
|
call assert_equal(g:terminal_ansi_colors, term_getansicolors(buf))
|
||||||
@@ -1476,6 +1482,9 @@ func Test_terminal_ansicolors_global()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_terminal_ansicolors_func()
|
func Test_terminal_ansicolors_func()
|
||||||
|
if !exists('*term_getansicolors')
|
||||||
|
throw 'Skipped: term_getansicolors() not supported'
|
||||||
|
endif
|
||||||
let g:terminal_ansi_colors = reverse(copy(s:test_colors))
|
let g:terminal_ansi_colors = reverse(copy(s:test_colors))
|
||||||
let buf = Run_shell_in_terminal({'ansi_colors': s:test_colors})
|
let buf = Run_shell_in_terminal({'ansi_colors': s:test_colors})
|
||||||
call assert_equal(s:test_colors, term_getansicolors(buf))
|
call assert_equal(s:test_colors, term_getansicolors(buf))
|
||||||
|
@@ -777,6 +777,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 */
|
||||||
|
/**/
|
||||||
|
1634,
|
||||||
/**/
|
/**/
|
||||||
1633,
|
1633,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user