aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-11-22 21:33:13 +0100
committerJustin M. Keyes <justinkz@gmail.com>2016-11-25 15:46:58 +0100
commit0de6f450e47d09b0432e41f2ab61a0981f056767 (patch)
treeabd5c1cf83c1eb36ac106a8083ba8baf44becfaa
parent42736d6a2a1fe97b462b6fcef11a7ae655287975 (diff)
downloadrneovim-0de6f450e47d09b0432e41f2ab61a0981f056767.tar.gz
rneovim-0de6f450e47d09b0432e41f2ab61a0981f056767.tar.bz2
rneovim-0de6f450e47d09b0432e41f2ab61a0981f056767.zip
vim-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. https://github.com/vim/vim/commit/ac105ed3c420660ddbddc501c97875c48220817e
-rw-r--r--src/nvim/testdir/runtest.vim8
-rw-r--r--src/nvim/testdir/test_expr_utf8.vim1
-rw-r--r--src/nvim/testdir/test_regexp_utf8.vim1
-rw-r--r--src/nvim/testdir/test_visual.vim1
-rw-r--r--src/nvim/version.c2
5 files changed, 9 insertions, 4 deletions
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim
index e2d1e67a22..34b6b846ca 100644
--- a/src/nvim/testdir/runtest.vim
+++ b/src/nvim/testdir/runtest.vim
@@ -42,6 +42,14 @@ endif
" This also enables use of line continuation.
set 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/nvim/testdir/test_expr_utf8.vim b/src/nvim/testdir/test_expr_utf8.vim
index 7bdcb4f65f..9ea6d8872b 100644
--- a/src/nvim/testdir/test_expr_utf8.vim
+++ b/src/nvim/testdir/test_expr_utf8.vim
@@ -2,7 +2,6 @@
if !has('multi_byte')
finish
endif
-scriptencoding utf-8
func Test_strgetchar_utf8()
call assert_equal(char2nr('á'), strgetchar('áxb', 0))
diff --git a/src/nvim/testdir/test_regexp_utf8.vim b/src/nvim/testdir/test_regexp_utf8.vim
index 38f9ed41d5..ecb03a0f8c 100644
--- a/src/nvim/testdir/test_regexp_utf8.vim
+++ b/src/nvim/testdir/test_regexp_utf8.vim
@@ -1,5 +1,4 @@
" Tests for regexp in utf8 encoding
-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/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim
index 83bae967e2..cf0e535937 100644
--- a/src/nvim/testdir/test_visual.vim
+++ b/src/nvim/testdir/test_visual.vim
@@ -2,7 +2,6 @@
if !has('multi_byte')
finish
endif
-scriptencoding utf-8
if !has('visual')
finish
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 5bcda0bedf..82a6f5f9a9 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -356,7 +356,7 @@ static int included_patches[] = {
// 2089 NA
// 2088,
// 2087,
- // 2086,
+ 2086,
// 2085,
// 2084,
// 2083,