summaryrefslogtreecommitdiffstats
path: root/tests/text.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2014-11-21 22:45:09 (GMT)
committerfvogel <fvogelnew1@free.fr>2014-11-21 22:45:09 (GMT)
commit94831611278c36aeb3cea4a1e509446ead130ba9 (patch)
treeca63d8f48ef3de16403945b4f136ea53931a07d1 /tests/text.test
parent629f5a862e30b7e3136c4b2a5580d5acaa1993db (diff)
downloadtk-94831611278c36aeb3cea4a1e509446ead130ba9.zip
tk-94831611278c36aeb3cea4a1e509446ead130ba9.tar.gz
tk-94831611278c36aeb3cea4a1e509446ead130ba9.tar.bz2
Added tests for bug [c24b97d905] - text count -displaylines is wrong with elided newlinesbug_c24b97d905
Diffstat (limited to 'tests/text.test')
-rw-r--r--tests/text.test34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/text.test b/tests/text.test
index 3f407e6..6121b85 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -699,6 +699,40 @@ test text-9.2.44 {TextWidgetCmd procedure, "count" option} -setup {
.t tag configure hidden -elide true
lappend res [.t count -displaylines 1.19 3.24] [.t count -displaylines 1.0 end]
} -result {2 6 1 5}
+test text-9.2.45 {TextWidgetCmd procedure, "count" option} -setup {
+ .t delete 1.0 end
+ update
+ set res {}
+} -body {
+ for {set i 1} {$i < 5} {incr i} {
+ .t insert end "Line $i+++Line $i---Line $i///Line $i - This is Line [format %c [expr 64+$i]]\n"
+ }
+ .t tag configure hidden -elide true
+ .t tag add hidden 2.15 3.10
+ .t configure -wrap none
+ set res [.t count -displaylines 2.0 3.0]
+} -result {0}
+test text-9.2.46 {TextWidgetCmd procedure, "count" option} -setup {
+ toplevel .mytop
+ pack [text .mytop.t]
+ wm geometry .mytop 100x300+0+0
+ .mytop.t delete 1.0 end
+ update
+ set res {}
+} -body {
+ for {set i 1} {$i < 5} {incr i} {
+ # 0 1 2 3 4
+ # 012345 678901234 567890123 456789012 34567890123456789
+ .mytop.t insert end "Line $i+++Line $i---Line $i///Line $i - This is Line [format %c [expr 64+$i]]\n"
+ }
+ .mytop.t tag configure hidden -elide true
+ .mytop.t tag add hidden 2.15 3.10
+ .mytop.t configure -wrap char
+ lappend res [.mytop.t count -displaylines 2.0 3.0]
+ lappend res [.mytop.t count -displaylines 2.0 3.40]
+} -cleanup {
+ destroy .mytop
+} -result {1 3}
# Newer tags are higher priority
.t tag configure elide1 -elide 0