summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_regexp_utf8.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-09 19:34:54 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-09 19:34:54 +0200
commit59de417b904bbd204e313f015839317b577bd124 (patch)
tree4ebd73ce6e4ccd65b8a595f388c4535d81387319 /src/testdir/test_regexp_utf8.vim
parentdcf59c37d0e1517439c4c0c4a6a5ca09c90157ad (diff)
patch 8.2.0938: NFA regexp uses tolower ()to compare ignore-casev8.2.0938
Problem: NFA regexp uses tolower() to compare ignore-case. (Thayne McCombs) Solution: Use utf_fold() when possible. (ref. neovim #12456)
Diffstat (limited to 'src/testdir/test_regexp_utf8.vim')
-rw-r--r--src/testdir/test_regexp_utf8.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_regexp_utf8.vim b/src/testdir/test_regexp_utf8.vim
index e9d5507114..e8e67a62ce 100644
--- a/src/testdir/test_regexp_utf8.vim
+++ b/src/testdir/test_regexp_utf8.vim
@@ -355,4 +355,23 @@ func Test_ambiwidth()
set regexpengine& ambiwidth&
endfunc
+func Run_regexp_ignore_case()
+ call assert_equal('iIİ', substitute('iIİ', '\([iIİ]\)', '\1', 'g'))
+
+ call assert_equal('iIx', substitute('iIİ', '\c\([İ]\)', 'x', 'g'))
+ call assert_equal('xxİ', substitute('iIİ', '\(i\c\)', 'x', 'g'))
+ call assert_equal('iIx', substitute('iIİ', '\(İ\c\)', 'x', 'g'))
+ call assert_equal('iIx', substitute('iIİ', '\c\(\%u0130\)', 'x', 'g'))
+ call assert_equal('iIx', substitute('iIİ', '\c\([\u0130]\)', 'x', 'g'))
+ call assert_equal('iIx', substitute('iIİ', '\c\([\u012f-\u0131]\)', 'x', 'g'))
+endfunc
+
+func Test_regexp_ignore_case()
+ set regexpengine=1
+ call Run_regexp_ignore_case()
+ set regexpengine=2
+ call Run_regexp_ignore_case()
+ set regexpengine&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab