mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
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.
This commit is contained in:
@@ -49,6 +49,14 @@ source setup.vim
|
|||||||
" This also enables use of line continuation.
|
" This also enables use of line continuation.
|
||||||
set nocp viminfo+=nviminfo
|
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
|
" Avoid stopping at the "hit enter" prompt
|
||||||
set nomore
|
set nomore
|
||||||
|
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
" A series of tests that can run in one Vim invocation.
|
" A series of tests that can run in one Vim invocation.
|
||||||
" This makes testing go faster, since Vim doesn't need to restart.
|
" 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.
|
" files, so that they can be run by themselves.
|
||||||
|
|
||||||
source test_expr_utf8.vim
|
source test_expr_utf8.vim
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
" Test for channel functions.
|
" Test for channel functions.
|
||||||
scriptencoding utf-8
|
|
||||||
|
|
||||||
if !has('channel')
|
if !has('channel')
|
||||||
finish
|
finish
|
||||||
|
@@ -4,9 +4,6 @@ if !has("digraphs") || !has("multi_byte")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
set enc=utf-8
|
|
||||||
scriptencoding utf-8
|
|
||||||
|
|
||||||
func! Put_Dig(chars)
|
func! Put_Dig(chars)
|
||||||
exe "norm! o\<c-k>".a:chars
|
exe "norm! o\<c-k>".a:chars
|
||||||
endfu
|
endfu
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
scriptencoding utf-8
|
|
||||||
|
|
||||||
func s:test_expand_dllpath(optname)
|
func s:test_expand_dllpath(optname)
|
||||||
let $TEST_EXPAND_DLLPATH = '/dllpath/lib' . substitute(a:optname, '\zedll$', '.', '')
|
let $TEST_EXPAND_DLLPATH = '/dllpath/lib' . substitute(a:optname, '\zedll$', '.', '')
|
||||||
execute 'let dllpath_save = &' . a:optname
|
execute 'let dllpath_save = &' . a:optname
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
if !has('multi_byte')
|
if !has('multi_byte')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
set encoding=utf-8
|
|
||||||
scriptencoding utf-8
|
|
||||||
|
|
||||||
func Test_strgetchar()
|
func Test_strgetchar()
|
||||||
call assert_equal(char2nr('á'), strgetchar('áxb', 0))
|
call assert_equal(char2nr('á'), strgetchar('áxb', 0))
|
||||||
|
@@ -1,12 +1,9 @@
|
|||||||
" Test for JSON functions.
|
" Test for JSON functions.
|
||||||
|
|
||||||
" JSON requires using utf-8. Conversion breaks the asserts, therefore set
|
" JSON requires using utf-8, because conversion breaks the asserts.
|
||||||
" 'encoding' to utf-8.
|
|
||||||
if !has('multi_byte')
|
if !has('multi_byte')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
set encoding=utf-8
|
|
||||||
scriptencoding utf-8
|
|
||||||
|
|
||||||
let s:json1 = '"str\"in\\g"'
|
let s:json1 = '"str\"in\\g"'
|
||||||
let s:var1 = "str\"in\\g"
|
let s:var1 = "str\"in\\g"
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
if !has('conceal') || !has('multi_byte')
|
if !has('conceal') || !has('multi_byte')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
set encoding=utf-8
|
|
||||||
scriptencoding utf-8
|
|
||||||
|
|
||||||
if !has('gui_running') && has('unix')
|
if !has('gui_running') && has('unix')
|
||||||
set term=ansi
|
set term=ansi
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
if !has('multi_byte')
|
if !has('multi_byte')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
set encoding=utf-8
|
|
||||||
scriptencoding utf-8
|
|
||||||
|
|
||||||
func s:equivalence_test()
|
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źżžƶẑẕ"
|
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źżžƶẑẕ"
|
||||||
|
@@ -1,9 +1,7 @@
|
|||||||
" Tests for Visual mode
|
" Tests for Visual mode. Uses double-wide character.
|
||||||
if !has('multi_byte')
|
if !has('multi_byte')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
set encoding=utf-8
|
|
||||||
scriptencoding utf-8
|
|
||||||
|
|
||||||
if !has('visual')
|
if !has('visual')
|
||||||
finish
|
finish
|
||||||
|
@@ -758,6 +758,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2086,
|
||||||
/**/
|
/**/
|
||||||
2085,
|
2085,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user