]> granicus.if.org Git - vim/commitdiff
patch 8.1.0970: text properties test fails when 'encoding' is not utf-8 v8.1.0970
authorBram Moolenaar <Bram@vim.org>
Fri, 22 Feb 2019 13:38:58 +0000 (14:38 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 22 Feb 2019 13:38:58 +0000 (14:38 +0100)
Problem:    Text properties test fails when 'encoding' is not utf-8.
Solution:   Compare with original value of 'encoding'. (Christian Brabandt,
            closes #3986)

src/testdir/runtest.vim
src/testdir/test_textprop.vim
src/version.c

index 9108b8e6813883817e591b0b0d42d52d840bb32a..2a1b5ea5cc238927a14e8fc82b2efb3e5ba9ae6f 100644 (file)
@@ -50,7 +50,9 @@ source setup.vim
 set nocp viminfo+=nviminfo
 
 " Use utf-8 by default, instead of whatever the system default happens to be.
-" Individual tests can overrule this at the top of the file.
+" Individual tests can overrule this at the top of the file and use
+" g:orig_encoding if needed.
+let g:orig_encoding = &encoding
 set encoding=utf-8
 
 " REDIR_TEST_TO_NULL has a very permissive SwapExists autocommand which is for
index 311f30fbf3cf4a5659cd6f4f786ddcc46b69682b..5ea551750545b3efd6dbddbacd9c5a6f6c72d903 100644 (file)
@@ -518,7 +518,8 @@ endfunc
 
 " screenshot test with textprop highlighting
 funct Test_textprop_screenshots()
-  if !CanRunVimInTerminal() || &encoding != 'utf-8'
+  " The Vim running in the terminal needs to use utf-8.
+  if !CanRunVimInTerminal() || g:orig_encoding != 'utf-8'
     return
   endif
   call writefile([
index cd45fa01894fbb3faf6972826a2ae3ea59d5850f..c4034ee29c2452b9486b2b32aac10187f0c3f6ed 100644 (file)
@@ -779,6 +779,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    970,
 /**/
     969,
 /**/