summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-21 20:33:32 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-21 20:33:32 +0200
commitac105ed3c420660ddbddc501c97875c48220817e (patch)
treeaf1f72494dadb3775100f85e65c8e0e970879e56
parentdfd63e30d13fff5603416b6c7e247cebeb003eb0 (diff)
downloadvim-ac105ed3c420660ddbddc501c97875c48220817e.zip
patch 7.4.2086
Problem: Using the system default encoding makes tests unpredictable. Solution: Always use utf-8 or latin1 in the new style tests. Remove setting encoding and scriptencoding where it is not needed.
-rw-r--r--src/testdir/runtest.vim8
-rw-r--r--src/testdir/test_alot_utf8.vim3
-rw-r--r--src/testdir/test_channel.vim1
-rw-r--r--src/testdir/test_digraph.vim3
-rw-r--r--src/testdir/test_expand_dllpath.vim2
-rw-r--r--src/testdir/test_expr_utf8.vim2
-rw-r--r--src/testdir/test_json.vim5
-rw-r--r--src/testdir/test_matchadd_conceal_utf8.vim2
-rw-r--r--src/testdir/test_regexp_utf8.vim2
-rw-r--r--src/testdir/test_visual.vim4
-rw-r--r--src/version.c2
11 files changed, 14 insertions, 20 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index 559d5f875..e06e0cbdf 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -49,6 +49,14 @@ source setup.vim
" This also enables use of line continuation.
set nocp viminfo+=nviminfo
+" Use utf-8 or latin1 be default, instead of whatever the system default
+" happens to be. Individual tests can overrule this at the top of the file.
+if has('multi_byte')
+ set encoding=utf-8
+else
+ set encoding=latin1
+endif
+
" Avoid stopping at the "hit enter" prompt
set nomore
diff --git a/src/testdir/test_alot_utf8.vim b/src/testdir/test_alot_utf8.vim
index 8824ee5e1..049251f9a 100644
--- a/src/testdir/test_alot_utf8.vim
+++ b/src/testdir/test_alot_utf8.vim
@@ -1,7 +1,8 @@
" A series of tests that can run in one Vim invocation.
" This makes testing go faster, since Vim doesn't need to restart.
-" These tests use utf8 'encoding'. Setting 'encoding' is in the individual
+" These tests use utf8 'encoding'. Setting 'encoding' is already done in
+" runtest.vim. Checking for the multi_byte feature is in the individual
" files, so that they can be run by themselves.
source test_expr_utf8.vim
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index af9060a78..e00cc502b 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1,5 +1,4 @@
" Test for channel functions.
-scriptencoding utf-8
if !has('channel')
finish
diff --git a/src/testdir/test_digraph.vim b/src/testdir/test_digraph.vim
index 60ae1fd3f..12cda4d46 100644
--- a/src/testdir/test_digraph.vim
+++ b/src/testdir/test_digraph.vim
@@ -4,9 +4,6 @@ if !has("digraphs") || !has("multi_byte")
finish
endif
-set enc=utf-8
-scriptencoding utf-8
-
func! Put_Dig(chars)
exe "norm! o\<c-k>".a:chars
endfu
diff --git a/src/testdir/test_expand_dllpath.vim b/src/testdir/test_expand_dllpath.vim
index e69e7e1b3..d8ab41668 100644
--- a/src/testdir/test_expand_dllpath.vim
+++ b/src/testdir/test_expand_dllpath.vim
@@ -1,5 +1,3 @@
-scriptencoding utf-8
-
func s:test_expand_dllpath(optname)
let $TEST_EXPAND_DLLPATH = '/dllpath/lib' . substitute(a:optname, '\zedll$', '.', '')
execute 'let dllpath_save = &' . a:optname
diff --git a/src/testdir/test_expr_utf8.vim b/src/testdir/test_expr_utf8.vim
index e8246ef38..1737a9f74 100644
--- a/src/testdir/test_expr_utf8.vim
+++ b/src/testdir/test_expr_utf8.vim
@@ -2,8 +2,6 @@
if !has('multi_byte')
finish
endif
-set encoding=utf-8
-scriptencoding utf-8
func Test_strgetchar()
call assert_equal(char2nr('á'), strgetchar('áxb', 0))
diff --git a/src/testdir/test_json.vim b/src/testdir/test_json.vim
index 589fcb9ed..e14903646 100644
--- a/src/testdir/test_json.vim
+++ b/src/testdir/test_json.vim
@@ -1,12 +1,9 @@
" Test for JSON functions.
-" JSON requires using utf-8. Conversion breaks the asserts, therefore set
-" 'encoding' to utf-8.
+" JSON requires using utf-8, because conversion breaks the asserts.
if !has('multi_byte')
finish
endif
-set encoding=utf-8
-scriptencoding utf-8
let s:json1 = '"str\"in\\g"'
let s:var1 = "str\"in\\g"
diff --git a/src/testdir/test_matchadd_conceal_utf8.vim b/src/testdir/test_matchadd_conceal_utf8.vim
index 8293fbe75..34d3ee28f 100644
--- a/src/testdir/test_matchadd_conceal_utf8.vim
+++ b/src/testdir/test_matchadd_conceal_utf8.vim
@@ -2,8 +2,6 @@
if !has('conceal') || !has('multi_byte')
finish
endif
-set encoding=utf-8
-scriptencoding utf-8
if !has('gui_running') && has('unix')
set term=ansi
diff --git a/src/testdir/test_regexp_utf8.vim b/src/testdir/test_regexp_utf8.vim
index 6247b30e6..81d8f5b04 100644
--- a/src/testdir/test_regexp_utf8.vim
+++ b/src/testdir/test_regexp_utf8.vim
@@ -2,8 +2,6 @@
if !has('multi_byte')
finish
endif
-set encoding=utf-8
-scriptencoding utf-8
func s:equivalence_test()
let str = "AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐẔ aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑẕ"
diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim
index 177f57145..240546bc2 100644
--- a/src/testdir/test_visual.vim
+++ b/src/testdir/test_visual.vim
@@ -1,9 +1,7 @@
-" Tests for Visual mode
+" Tests for Visual mode. Uses double-wide character.
if !has('multi_byte')
finish
endif
-set encoding=utf-8
-scriptencoding utf-8
if !has('visual')
finish
diff --git a/src/version.c b/src/version.c
index 6f9ce5d30..9af59e55c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2086,
+/**/
2085,
/**/
2084,