summaryrefslogtreecommitdiffstats
path: root/tests/text.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-02-06 16:57:24 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-02-06 16:57:24 (GMT)
commit6b00db07c84b661e9971e8aff1ae241138cea97f (patch)
tree2e399b6ac70b26c14f70092ed8efc1f4fa0e82da /tests/text.test
parente9043031de3669be8a342498ecbc78cfdc67f054 (diff)
parent7fa5cdb9c367a0587e135892aa12345045fb2b92 (diff)
downloadtk-6b00db07c84b661e9971e8aff1ae241138cea97f.zip
tk-6b00db07c84b661e9971e8aff1ae241138cea97f.tar.gz
tk-6b00db07c84b661e9971e8aff1ae241138cea97f.tar.bz2
Merge bug fixes from fvogel's text-elided branch
Diffstat (limited to 'tests/text.test')
-rw-r--r--tests/text.test54
1 files changed, 53 insertions, 1 deletions
diff --git a/tests/text.test b/tests/text.test
index 52689ba..e75f38a 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -698,7 +698,59 @@ test text-9.2.44 {TextWidgetCmd procedure, "count" option} -setup {
.t tag add hidden 2.9 3.17
.t tag configure hidden -elide true
lappend res [.t count -displaylines 1.19 3.24] [.t count -displaylines 1.0 end]
-} -result {2 6 2 5}
+} -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}
+test text-9.2.47 {TextWidgetCmd procedure, "count" option} -setup {
+ .t delete 1.0 end
+ update
+ set res {}
+} -body {
+ for {set i 1} {$i < 25} {incr i} {
+ .t insert end "Line $i\n"
+ }
+ .t tag configure hidden -elide true
+ .t tag add hidden 5.7 11.0
+ update
+ set y1 [lindex [.t yview] 1]
+ .t count -displaylines 5.0 11.0
+ set y2 [lindex [.t yview] 1]
+ .t count -displaylines 5.0 12.0
+ set y3 [lindex [.t yview] 1]
+ list [expr {$y1 == $y2}] [expr {$y1 == $y3}]
+} -result {1 1}
# Newer tags are higher priority
.t tag configure elide1 -elide 0