Mercurial > vim
changeset 15928:857ce36c8412 v8.1.0970
patch 8.1.0970: text properties test fails when 'encoding' is not utf-8
commit https://github.com/vim/vim/commit/ed79d1e348c40e2432802423bf22e4f7b536bf8a
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 22 14:38:58 2019 +0100
patch 8.1.0970: text properties test fails when 'encoding' is not utf-8
Problem: Text properties test fails when 'encoding' is not utf-8.
Solution: Compare with original value of 'encoding'. (Christian Brabandt,
closes #3986)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 22 Feb 2019 14:45:07 +0100 |
parents | ea530928c116 |
children | b6a90f793191 |
files | src/testdir/runtest.vim src/testdir/test_textprop.vim src/version.c |
diffstat | 3 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -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
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -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([