summaryrefslogtreecommitdiffstats
path: root/tests/text.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-10-06 22:47:31 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-10-06 22:47:31 (GMT)
commit030aca39c08ef652e36870abdeee1bc2f2566e28 (patch)
treece7358fc470bb9a5dc21e7a8d14741b5dcd29ad9 /tests/text.test
parentf87593b772ee7134676c3a73f132bd8b8bf592e9 (diff)
downloadtk-030aca39c08ef652e36870abdeee1bc2f2566e28.zip
tk-030aca39c08ef652e36870abdeee1bc2f2566e28.tar.gz
tk-030aca39c08ef652e36870abdeee1bc2f2566e28.tar.bz2
Added test for bug [2262711fff] - Regexp search fails with Unicode and elide
Diffstat (limited to 'tests/text.test')
-rw-r--r--tests/text.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/text.test b/tests/text.test
index fa00ce3..ee75a6c 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -2781,6 +2781,24 @@ test text-20.185 {TextSearchCmd, elide up to match} {
lappend res [.t2 search -regexp bc 1.0]
lappend res [.t2 search -regexp c 1.0]
} {{} {} 1.0 2.1 2.0 3.1 2.0 3.0}
+test text-20.185.1 {TextSearchCmd, elide up to match, with UTF-8 chars before the match} {
+ deleteWindows
+ pack [text .t2]
+ .t2 tag configure e -elide 0
+ .t2 insert end A {} xyz e bb\n
+ .t2 insert end \u00c4 {} xyz e bb
+ set res {}
+ lappend res [.t2 search bb 1.0 "1.0 lineend"]
+ lappend res [.t2 search bb 2.0 "2.0 lineend"]
+ lappend res [.t2 search -regexp bb 1.0 "1.0 lineend"]
+ lappend res [.t2 search -regexp bb 2.0 "2.0 lineend"]
+ .t2 tag configure e -elide 1
+ lappend res [.t2 search bb 1.0 "1.0 lineend"]
+ lappend res [.t2 search bb 2.0 "2.0 lineend"]
+ lappend res [.t2 search -regexp bb 1.0 "1.0 lineend"]
+ lappend res [.t2 search -regexp -elide bb 2.0 "2.0 lineend"]
+ lappend res [.t2 search -regexp bb 2.0 "2.0 lineend"]
+} {1.4 2.4 1.4 2.4 1.4 2.4 1.4 2.4 2.4}
test text-20.186 {TextSearchCmd, strict limits} {
deleteWindows
pack [text .t2]