aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_regexp_utf8.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-06-09 18:17:47 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-06-18 18:01:42 -0400
commit33985a3a15fac1486cc11e8df272a0eeaa5fc77d (patch)
tree5f182fb2f99ee0d1e42052e2a314d10f6de607f1 /src/nvim/testdir/test_regexp_utf8.vim
parentb7cae2bca3028c170871f05670bbd6a7ad508c56 (diff)
downloadrneovim-33985a3a15fac1486cc11e8df272a0eeaa5fc77d.tar.gz
rneovim-33985a3a15fac1486cc11e8df272a0eeaa5fc77d.tar.bz2
rneovim-33985a3a15fac1486cc11e8df272a0eeaa5fc77d.zip
vim-patch:8.2.0938: NFA regexp uses tolower ()to compare ignore-case
Problem: NFA regexp uses tolower() to compare ignore-case. (Thayne McCombs) Solution: Use utf_fold() when possible. (ref. neovim vim/vim#12456) https://github.com/vim/vim/commit/59de417b904bbd204e313f015839317b577bd124
Diffstat (limited to 'src/nvim/testdir/test_regexp_utf8.vim')
-rw-r--r--src/nvim/testdir/test_regexp_utf8.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_regexp_utf8.vim b/src/nvim/testdir/test_regexp_utf8.vim
index ecd0e8d56b..f48458566b 100644
--- a/src/nvim/testdir/test_regexp_utf8.vim
+++ b/src/nvim/testdir/test_regexp_utf8.vim
@@ -332,4 +332,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