comparison src/testdir/test_regexp_utf8.vim @ 20772:097f5b5c907b v8.2.0938

patch 8.2.0938: NFA regexp uses tolower ()to compare ignore-case Commit: https://github.com/vim/vim/commit/59de417b904bbd204e313f015839317b577bd124 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 9 19:34:54 2020 +0200 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 https://github.com/vim/vim/issues/12456)
author Bram Moolenaar <Bram@vim.org>
date Tue, 09 Jun 2020 19:45:03 +0200
parents bb87c5c1e29b
children 6d8696fd4945
comparison
equal deleted inserted replaced
20771:8aa004f7e48f 20772:097f5b5c907b
353 set regexpengine=2 ambiwidth=double 353 set regexpengine=2 ambiwidth=double
354 call assert_equal(0, match("\u00EC", '\p')) 354 call assert_equal(0, match("\u00EC", '\p'))
355 set regexpengine& ambiwidth& 355 set regexpengine& ambiwidth&
356 endfunc 356 endfunc
357 357
358 func Run_regexp_ignore_case()
359 call assert_equal('iIİ', substitute('iIİ', '\([iIİ]\)', '\1', 'g'))
360
361 call assert_equal('iIx', substitute('iIİ', '\c\([İ]\)', 'x', 'g'))
362 call assert_equal('xxİ', substitute('iIİ', '\(i\c\)', 'x', 'g'))
363 call assert_equal('iIx', substitute('iIİ', '\(İ\c\)', 'x', 'g'))
364 call assert_equal('iIx', substitute('iIİ', '\c\(\%u0130\)', 'x', 'g'))
365 call assert_equal('iIx', substitute('iIİ', '\c\([\u0130]\)', 'x', 'g'))
366 call assert_equal('iIx', substitute('iIİ', '\c\([\u012f-\u0131]\)', 'x', 'g'))
367 endfunc
368
369 func Test_regexp_ignore_case()
370 set regexpengine=1
371 call Run_regexp_ignore_case()
372 set regexpengine=2
373 call Run_regexp_ignore_case()
374 set regexpengine&
375 endfunc
376
358 " vim: shiftwidth=2 sts=2 expandtab 377 " vim: shiftwidth=2 sts=2 expandtab