summaryrefslogtreecommitdiffstats
path: root/tests/text.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-10-15 14:24:58 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-10-15 14:24:58 (GMT)
commitd7bb194757834cfa8a4b7c659588cdddea2a599f (patch)
tree449b43b633ab66c5a542e976737b1de05b862098 /tests/text.test
parent39b70555a69bfdb82be51d1c51f13e1b109a01a4 (diff)
downloadtk-d7bb194757834cfa8a4b7c659588cdddea2a599f.zip
tk-d7bb194757834cfa8a4b7c659588cdddea2a599f.tar.gz
tk-d7bb194757834cfa8a4b7c659588cdddea2a599f.tar.bz2
Backout the previously proposed fix [80286abf05], and add more tests.
Diffstat (limited to 'tests/text.test')
-rw-r--r--tests/text.test63
1 files changed, 57 insertions, 6 deletions
diff --git a/tests/text.test b/tests/text.test
index 6dc6999..b7071db 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -5873,33 +5873,84 @@ test text-22.225 {TextSearchCmd, strict limits} -body {
} -cleanup {
destroy .t
} -result {}
-test text-22.226 {TextSearchCmd, search for the empty string} -body {
+test text-22.226 {TextSearchCmd, exact search for the empty string} -body {
pack [text .t]
.t search "" 1.0
} -cleanup {
destroy .t
} -result {1.0}
-test text-22.227 {TextSearchCmd, search for the empty string} -body {
+test text-22.227 {TextSearchCmd, exact search for the empty string} -body {
pack [text .t]
.t insert end "Searching for the\nempty string!"
.t search "" 2.5
} -cleanup {
destroy .t
} -result {2.5}
-test text-22.228 {TextSearchCmd, search all empty strings} -body {
+test text-22.228 {TextSearchCmd, exact search all empty strings} -body {
pack [text .t]
.t search -all "" 1.0
} -cleanup {
destroy .t
} -result {1.0}
-test text-22.228 {TextSearchCmd, search all empty strings} -body {
+test text-22.229 {TextSearchCmd, exact search all empty strings} -body {
pack [text .t]
.t insert end "Searching for the\nempty string!"
- .t search -all "" 2.5
+ .t search -all "" 2.5 2.8
+} -cleanup {
+ destroy .t
+} -result {2.5 2.6 2.7}
+test text-22.230 {TextSearchCmd, exact search all empty strings, with overlap} -body {
+ pack [text .t]
+ .t search -all -overlap "" 1.0
+} -cleanup {
+ destroy .t
+} -result {1.0}
+test text-22.231 {TextSearchCmd, exact search all empty strings, with overlap} -body {
+ pack [text .t]
+ .t insert end "Searching for the\nempty string!"
+ .t search -all -overlap "" 2.5 2.8
+} -cleanup {
+ destroy .t
+} -result {2.5 2.6 2.7}
+test text-22.232 {TextSearchCmd, regexp search for the empty string} -body {
+ pack [text .t]
+ .t search -regexp "" 1.0
+} -cleanup {
+ destroy .t
+} -result {1.0}
+test text-22.233 {TextSearchCmd, regexp search for the empty string} -body {
+ pack [text .t]
+ .t insert end "Searching for the\nempty string!"
+ .t search -regexp "" 2.5
} -cleanup {
destroy .t
} -result {2.5}
-
+test text-22.234 {TextSearchCmd, regexp search all empty strings} -body {
+ pack [text .t]
+ .t search -all -regexp "" 1.0
+} -cleanup {
+ destroy .t
+} -result {1.0}
+test text-22.235 {TextSearchCmd, regexp search all empty strings} -body {
+ pack [text .t]
+ .t insert end "Searching for the\nempty string!"
+ .t search -all -regexp "" 2.5 2.8
+} -cleanup {
+ destroy .t
+} -result {2.5 2.6 2.7}
+test text-22.236 {TextSearchCmd, regexp search all empty strings, with overlap} -body {
+ pack [text .t]
+ .t search -all -regexp -overlap "" 1.0
+} -cleanup {
+ destroy .t
+} -result {1.0}
+test text-22.237 {TextSearchCmd, regexp search all empty strings, with overlap} -body {
+ pack [text .t]
+ .t insert end "Searching for the\nempty string!"
+ .t search -all -regexp -overlap "" 2.5 2.8
+} -cleanup {
+ destroy .t
+} -result {2.5 2.6 2.7}
test text-23.1 {TkTextGetTabs procedure} -setup {
text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100