diff options
author | fvogelnew1@free.fr <fvogel> | 2014-11-21 22:45:09 (GMT) |
---|---|---|
committer | fvogelnew1@free.fr <fvogel> | 2014-11-21 22:45:09 (GMT) |
commit | 468c69c64d2e0a365e9bdf75aeccb3621b7ab78f (patch) | |
tree | ca63d8f48ef3de16403945b4f136ea53931a07d1 /tests/text.test | |
parent | 943fa965c46c715dce18664f2f1fa7989819ab2c (diff) | |
download | tk-468c69c64d2e0a365e9bdf75aeccb3621b7ab78f.zip tk-468c69c64d2e0a365e9bdf75aeccb3621b7ab78f.tar.gz tk-468c69c64d2e0a365e9bdf75aeccb3621b7ab78f.tar.bz2 |
Added tests for bug [c24b97d905] - text count -displaylines is wrong with elided newlines
Diffstat (limited to 'tests/text.test')
-rw-r--r-- | tests/text.test | 34 |
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 |