diff src/testdir/test_terminal.vim @ 15231:42ce33efb23d v8.1.0625

patch 8.1.0625: MS-Windows: terminal test fails in white console commit https://github.com/vim/vim/commit/81df63537e281da38b45bc1806e2b4582e804242 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 22 18:25:30 2018 +0100 patch 8.1.0625: MS-Windows: terminal test fails in white console Problem: MS-Windows: terminal test fails in white console. Solution: Accept both white and black background colors.
author Bram Moolenaar <Bram@vim.org>
date Sat, 22 Dec 2018 18:30:05 +0100
parents 49bc670c3ee9
children 74bc96b99f4f
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -159,10 +159,16 @@ func Check_123(buf)
   call assert_equal('2', l[1].chars)
   call assert_equal('3', l[2].chars)
   call assert_equal('#00e000', l[0].fg)
-  if &background == 'light'
-    call assert_equal('#ffffff', l[0].bg)
+  if has('win32')
+    " On Windows 'background' always defaults to dark, even though the terminal
+    " may use a light background.  Therefore accept both white and black.
+    call assert_match('#ffffff\|#000000', l[0].bg)
   else
-    call assert_equal('#000000', l[0].bg)
+    if &background == 'light'
+      call assert_equal('#ffffff', l[0].bg)
+    else
+      call assert_equal('#000000', l[0].bg)
+    endif
   endif
 
   let l = term_getline(a:buf, -1)