From 4af0efa4cb10780f9c7d391eb66fe1c3367872d2 Mon Sep 17 00:00:00 2001 From: sebres Date: Fri, 28 Aug 2020 14:02:50 +0000 Subject: tests/regexp.test: added missing test that cover indices if running on string containing multi-byte utf-8 chars (de/ru, byte offsets != char offsets) --- tests/regexp.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/regexp.test b/tests/regexp.test index 362f425..99113ce 100644 --- a/tests/regexp.test +++ b/tests/regexp.test @@ -156,6 +156,10 @@ test regexp-3.7 {getting substrings back from regexp} { set foo 1; set f2 1; set f3 1; set f4 1 list [regexp -indices (a)(b)?(c) xacy foo f2 f3 f4] $foo $f2 $f3 $f4 } {1 {1 2} {1 1} {-1 -1} {2 2}} +test regexp-3.8 {-indices by multi-byte utf-8} { + regexp -inline -indices {(\w+)-(\w+)} \ + "gr\u00FC\u00DF-\u043F\u0440\u0438\u0432\u0435\u0442" +} {{0 10} {0 3} {5 10}} test regexp-4.1 {-nocase option to regexp} { regexp -nocase foo abcFOo -- cgit v0.12