vim-patch:7.4.1700

Problem:    Equivalence classes are not properly tested.
Solution:   Add tests for multi-byte and latin1. Fix an error. (Owen Leibman)

22e421549d

src/regexp.c changes weren't applied because they're specific to EBCDIC
handling, which has been dropped from nvim.

The latin1-specific tests were also removed since neovim intends to
remove the ability to have 'encoding' set to anything other than utf8.
This commit is contained in:
James McCoy 2016-08-16 21:47:54 -04:00
parent 71b3e20d0f
commit 35ddcc5bb4
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
3 changed files with 35 additions and 1 deletions

View File

@ -6,4 +6,5 @@ source test_cursor_func.vim
source test_cmdline.vim
source test_menu.vim
source test_popup.vim
source test_regexp_utf8.vim
source test_unlet.vim

View File

@ -0,0 +1,33 @@
" 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źżžƶẑẕ"
let groups = split(str)
for group1 in groups
for c in split(group1, '\zs')
" next statement confirms that equivalence class matches every
" character in group
call assert_match('^[[=' . c . '=]]*$', group1)
for group2 in groups
if group2 != group1
" next statement converts that equivalence class doesn't match
" character in any other group
call assert_equal(-1, match(group2, '[[=' . c . '=]]'))
endif
endfor
endfor
endfor
endfunc
func Test_equivalence_re1()
set re=1
call s:equivalence_test()
set re=0
endfunc
func Test_equivalence_re2()
set re=2
call s:equivalence_test()
set re=0
endfunc

View File

@ -577,7 +577,7 @@ static int included_patches[] = {
1703,
// 1702,
// 1701,
// 1700,
1700,
// 1699,
// 1698 NA
// 1697,