Skip to content

Commit 981d9dc

Browse files
committed
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)
1 parent b7ed839 commit 981d9dc

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/testdir/test_diffmode.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,9 @@ func Test_diff_of_diff()
909909
if !CanRunVimInTerminal()
910910
throw 'Skipped: cannot run Vim in a terminal window'
911911
endif
912+
if !has("rightleft")
913+
throw 'Skipped: rightleft not supported'
914+
endif
912915

913916
call writefile([
914917
\ 'call setline(1, ["aa","bb","cc","@@ -3,2 +5,7 @@","dd","ee","ff"])',

src/testdir/test_terminal.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,9 @@ func Test_terminal_api_call_fail_delete()
14341434
endfunc
14351435

14361436
func Test_terminal_ansicolors_default()
1437+
if !exists('*term_getansicolors')
1438+
throw 'Skipped: term_getansicolors() not supported'
1439+
endif
14371440
let colors = [
14381441
\ '#000000', '#e00000',
14391442
\ '#00e000', '#e0e000',
@@ -1465,6 +1468,9 @@ let s:test_colors = [
14651468
\]
14661469

14671470
func Test_terminal_ansicolors_global()
1471+
if !exists('*term_getansicolors')
1472+
throw 'Skipped: term_getansicolors() not supported'
1473+
endif
14681474
let g:terminal_ansi_colors = reverse(copy(s:test_colors))
14691475
let buf = Run_shell_in_terminal({})
14701476
call assert_equal(g:terminal_ansi_colors, term_getansicolors(buf))
@@ -1476,6 +1482,9 @@ func Test_terminal_ansicolors_global()
14761482
endfunc
14771483

14781484
func Test_terminal_ansicolors_func()
1485+
if !exists('*term_getansicolors')
1486+
throw 'Skipped: term_getansicolors() not supported'
1487+
endif
14791488
let g:terminal_ansi_colors = reverse(copy(s:test_colors))
14801489
let buf = Run_shell_in_terminal({'ansi_colors': s:test_colors})
14811490
call assert_equal(s:test_colors, term_getansicolors(buf))

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ static char *(features[]) =
777777

778778
static int included_patches[] =
779779
{ /* Add new patch number below this line */
780+
/**/
781+
1634,
780782
/**/
781783
1633,
782784
/**/

0 commit comments

Comments
 (0)