From 35ddcc5bb484d461e6381d9ddbdf0438446f1299 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 16 Aug 2016 21:47:54 -0400 Subject: [PATCH] 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) https://github.com/vim/vim/commit/22e421549d54147d003f6444de007cb1d73f1d27 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. --- src/nvim/testdir/test_alot.vim | 1 + src/nvim/testdir/test_regexp_utf8.vim | 33 +++++++++++++++++++++++++++ src/nvim/version.c | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/nvim/testdir/test_regexp_utf8.vim diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 30b8a9ceb8..daf6f026ba 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -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 diff --git a/src/nvim/testdir/test_regexp_utf8.vim b/src/nvim/testdir/test_regexp_utf8.vim new file mode 100644 index 0000000000..e1b1c2a9fb --- /dev/null +++ b/src/nvim/testdir/test_regexp_utf8.vim @@ -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 diff --git a/src/nvim/version.c b/src/nvim/version.c index 1cb8d128aa..9e3cea069c 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -577,7 +577,7 @@ static int included_patches[] = { 1703, // 1702, // 1701, - // 1700, + 1700, // 1699, // 1698 NA // 1697,