diff options
Diffstat (limited to 'tests/text.test')
-rw-r--r-- | tests/text.test | 115 |
1 files changed, 9 insertions, 106 deletions
diff --git a/tests/text.test b/tests/text.test index b34f6dd..3802746 100644 --- a/tests/text.test +++ b/tests/text.test @@ -1252,7 +1252,7 @@ bOy GIrl .#@? x_yz Line 7" .t configure -state disabled .t delete 2.3 - .t g 2.0 2.end + .t get 2.0 2.end } -cleanup { destroy .t } -result {abcdefghijklm} @@ -2103,7 +2103,7 @@ Line 7" .t count 5.7 5.3 } -cleanup { destroy .t -} -result {-4} +} -result -4 test text-10.7 {TextWidgetCmd procedure, "count" option} -setup { text .t .t insert 1.0 "Line 1 @@ -2598,7 +2598,7 @@ test text-10.31 {TextWidgetCmd procedure, "count" option} -setup { .t count -lines end 1.0 } -cleanup { destroy .t -} -result {-3} +} -result -3 test text-10.32 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2648,7 +2648,7 @@ test text-10.36 {TextWidgetCmd procedure, "count" option} -setup { .t count -lines 2.7 "1.0 lineend" } -cleanup { destroy .t -} -result {-1} +} -result -1 test text-10.37 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2691,7 +2691,7 @@ test text-10.39 {TextWidgetCmd procedure, "count" option} -setup { } -cleanup { destroy .t } -result {2 6 1 5} -test text-9.2.45 {TextWidgetCmd procedure, "count" option} -setup { +test text-10.40 {TextWidgetCmd procedure, "count" option} -setup { text .t pack .t update @@ -2707,7 +2707,7 @@ test text-9.2.45 {TextWidgetCmd procedure, "count" option} -setup { } -cleanup { destroy .t } -result 0 -test text-9.2.46 {TextWidgetCmd procedure, "count" option} -setup { +test text-10.41 {TextWidgetCmd procedure, "count" option} -setup { toplevel .mytop pack [text .mytop.t -font TkFixedFont -bd 0 -padx 0 -wrap char] set spec [font measure TkFixedFont "Line 1+++Line 1---Li"] ; # 20 chars @@ -2729,7 +2729,7 @@ test text-9.2.46 {TextWidgetCmd procedure, "count" option} -setup { } -cleanup { destroy .mytop } -result {1 3} -test text-9.2.47 {TextWidgetCmd procedure, "count" option} -setup { +test text-10.42 {TextWidgetCmd procedure, "count" option} -setup { text .t pack .t update @@ -6759,7 +6759,7 @@ test text-27.15g {No <<Selection>> virtual event on <<Cut>> without widget selec destroy .t } -result {no_<<Selection>>_event_fired} test text-27.16 {-maxundo configuration option} -body { - text .t -undo 1 -autoseparators 1 -maxundo 2 + text .t -undo 1 -autoseparators 1 -maxundo 2 pack .t .t insert end "line 1\n" .t delete 1.4 1.6 @@ -7540,100 +7540,6 @@ test text-32.4 {peer widget -start, -endline and deletion (bug 1630262)} -setup destroy .pt .t } -result {5 11 8 10 5 8 6 8 22 27 38 44 55 60 57 57} -test text-32.2 {peer widget -start, -endline and deletion (bug 1630262)} -setup { - destroy .t .pt - set res {} -} -body { - text .t - .t peer create .pt - for {set i 1} {$i < 100} {incr i} { - .t insert end "Line $i\n" - } - .t configure -startline 5 - # none of the following delete shall crash - # (all did before fixing bug 1630262) - # 1. delete on the same line: line1 == line2 in DeleteIndexRange, - # and resetView is true neither for .t not for .pt - .pt delete 2.0 2.2 - # 2. delete just one line: line1 < line2 in DeleteIndexRange, - # and resetView is true only for .t, not for .pt - .pt delete 2.0 3.0 - # 3. delete several lines: line1 < line2 in DeleteIndexRange, - # and resetView is true only for .t, not for .pt - .pt delete 2.0 5.0 - # 4. delete to the end line: line1 < line2 in DeleteIndexRange, - # and resetView is true only for .t, not for .pt - .pt delete 2.0 end - # this test succeeds provided there is no crash - set res 1 -} -cleanup { - destroy .pt -} -result 1 - -test text-32.3 {peer widget -start, -endline and deletion (bug 1630262)} -setup { - destroy .t .pt - set res {} -} -body { - text .t - .t peer create .pt - for {set i 1} {$i < 100} {incr i} { - .t insert end "Line $i\n" - } - .t configure -startline 5 - .pt configure -startline 3 - # the following delete shall not crash - # (it did before fixing bug 1630262) - .pt delete 2.0 3.0 - # moreover -startline shall be correct - # (was wrong before fixing bug 1630262) - lappend res [.t cget -start] [.pt cget -start] -} -cleanup { - destroy .pt -} -result {4 3} - -test text-32.4 {peer widget -start, -endline and deletion (bug 1630262)} -setup { - destroy .t .pt - set res {} -} -body { - text .t - .t peer create .pt - for {set i 1} {$i < 100} {incr i} { - .t insert end "Line $i\n" - } - .t configure -startline 5 -endline 15 - .pt configure -startline 8 -endline 12 - # .pt now shows a range entirely inside the range of .pt - # from .t, delete lines located after [.pt cget -end] - .t delete 9.0 10.0 - # from .t, delete lines straddling [.pt cget -end] - .t delete 6.0 9.0 - lappend res [.t cget -start] [.t cget -end] [.pt cget -start] [.pt cget -end] - .t configure -startline 5 -endline 12 - .pt configure -startline 8 -endline 12 - # .pt now shows again a range entirely inside the range of .pt - # from .t, delete lines located before [.pt cget -start] - .t delete 2.0 3.0 - # from .t, delete lines straddling [.pt cget -start] - .t delete 2.0 5.0 - lappend res [.t cget -start] [.t cget -end] [.pt cget -start] [.pt cget -end] - .t configure -startline 22 -endline 31 - .pt configure -startline 42 -endline 51 - # .t now shows a range entirely before the range of .pt - # from .t, delete some lines, then do it from .pt - .t delete 2.0 3.0 - .t delete 2.0 5.0 - .pt delete 2.0 5.0 - lappend res [.t cget -start] [.t cget -end] [.pt cget -start] [.pt cget -end] - .t configure -startline 55 -endline 75 - .pt configure -startline 60 -endline 70 - # .pt now shows a range entirely inside the range of .t - # from .t, delete a range straddling the entire range of .pt - .t delete 3.0 18.0 - lappend res [.t cget -start] [.t cget -end] [.pt cget -start] [.pt cget -end] -} -cleanup { - destroy .pt .t -} -result {5 11 8 10 5 8 6 8 22 27 38 44 55 60 57 57} - test text-33.1 {TextWidgetCmd procedure, "peer" option} -setup { text .t @@ -7652,7 +7558,7 @@ test text-33.2 {TextWidgetCmd procedure, "peer" option} -setup { test text-33.3 {TextWidgetCmd procedure, "peer" option} -setup { text .t } -body { - .t pee names + .t peer names } -cleanup { destroy .t } -returnCodes {ok} -result {} @@ -7768,7 +7674,6 @@ test text-34.1 {peer widget -start, -endline and selection} -setup { test text-35.1 {widget dump -command alters tags} -setup { proc Dumpy {key value index} { -#puts "KK: $key, $value" .t tag add $value [list $index linestart] [list $index lineend] } text .t @@ -7782,7 +7687,6 @@ test text-35.1 {widget dump -command alters tags} -setup { } -result {ok} test text-35.2 {widget dump -command makes massive changes} -setup { proc Dumpy {key value index} { -#puts "KK: $key, $value" .t delete 1.0 end } text .t @@ -7796,7 +7700,6 @@ test text-35.2 {widget dump -command makes massive changes} -setup { } -result {ok} test text-35.3 {widget dump -command destroys widget} -setup { proc Dumpy {key value index} { -#puts "KK: $key, $value" destroy .t } text .t |