]> granicus.if.org Git - vim/commitdiff
patch 7.4.2086 v7.4.2086
authorBram Moolenaar <Bram@vim.org>
Thu, 21 Jul 2016 18:33:32 +0000 (20:33 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 21 Jul 2016 18:33:32 +0000 (20:33 +0200)
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.

src/testdir/runtest.vim
src/testdir/test_alot_utf8.vim
src/testdir/test_channel.vim
src/testdir/test_digraph.vim
src/testdir/test_expand_dllpath.vim
src/testdir/test_expr_utf8.vim
src/testdir/test_json.vim
src/testdir/test_matchadd_conceal_utf8.vim
src/testdir/test_regexp_utf8.vim
src/testdir/test_visual.vim
src/version.c

index 559d5f875acc6e3358175c73e2ca10d941617c23..e06e0cbdf9fbff8d1ae5399aa062ac436b051ea7 100644 (file)
@@ -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
 
index 8824ee5e1525c0673bf35e59289964ce010422ca..049251f9a76c12a7cc096d1c1328c4a4f82e9384 100644 (file)
@@ -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
index af9060a78f402ba52de15fb5a99a9acd8917eb65..e00cc502b5627e3f8eaedba56e35fa9faaa46e20 100644 (file)
@@ -1,5 +1,4 @@
 " Test for channel functions.
-scriptencoding utf-8
 
 if !has('channel')
   finish
index 60ae1fd3f4ca7437f8c9f29bf8ea88250c6e0050..12cda4d46110045ed25cc7416b32e58f9bf72c42 100644 (file)
@@ -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
index e69e7e1b31c14f5a4b8724108acc89cbea1bf252..d8ab416681bd5c4dbdd7aa7075d89fd0fb83aec8 100644 (file)
@@ -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
index e8246ef383b190f5a267527e6231afa4ce9986b2..1737a9f745f6cd09503b0db398676b7b3a72d9df 100644 (file)
@@ -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))
index 589fcb9edcc10817187caa8501599fc19080d545..e1490364601472870b7b0e8c94fc846171aa421e 100644 (file)
@@ -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"
index 8293fbe75cdcb3d577e7c0f1dc5258f71e894712..34d3ee28f0da1fae50bfc78414c75246913173a8 100644 (file)
@@ -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
index 6247b30e6c220f328d506a9b7b9e19a118db942b..81d8f5b04a8e372e39180da5eed44fde8a059f07 100644 (file)
@@ -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źżžƶẑẕ"
index 177f571454ca29ff85e1f69a28f12086d6bb7368..240546bc23f0a558f523e90fdc2481b5fd0f6684 100644 (file)
@@ -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
index 6f9ce5d30d03b693f59ced2f0578fee3f71892eb..9af59e55c54723dd10a8466d58df42699d2124fa 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2086,
 /**/
     2085,
 /**/