summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-11-16 17:21:36 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-11-16 17:21:36 (GMT)
commit8c6ac85de70a9f2ce13eecd5605fb55cfde6d911 (patch)
treeb16e558ccd62ab007bd8981b7fdae2d5dc3ea4d1
parenta92a3f7a813cacc0b0d67d4ff73f703e50dfbfa3 (diff)
downloadtk-8c6ac85de70a9f2ce13eecd5605fb55cfde6d911.zip
tk-8c6ac85de70a9f2ce13eecd5605fb55cfde6d911.tar.gz
tk-8c6ac85de70a9f2ce13eecd5605fb55cfde6d911.tar.bz2
Better test for bug [2677890] since [19960bcef8] breaks relevance/efficiency of the previous version of textDisp-34.1
-rw-r--r--tests/textDisp.test41
1 files changed, 23 insertions, 18 deletions
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 9c6af70..4c88b38 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -4162,29 +4162,34 @@ test textDisp-33.5 {bold or italic fonts} win {
} {italic font measurement ok}
destroy .tt
-test textDisp-34.1 {Text widgets multi-scrolling problem: Bug 2677890} -setup {
- pack [text .t1 -width 10 -yscrollcommand {.sy set}] \
- [ttk::scrollbar .sy -orient vertical -command {.t1 yview}] \
- -side left -fill both
- bindtags .sy {}; # No clicky!
+test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup {
+ pack [text .t1] -expand 1 -fill both
set txt ""
- for {set i 0} {$i < 99} {incr i} {
- lappend txt "$i" [list pc $i] "\n" ""
+ for {set i 1} {$i < 100} {incr i} {
+ append txt "Line $i\n"
}
set result {}
} -body {
- .t1 insert end {*}$txt
- update
- lappend result [.sy get]
- .t1 replace 6.0 6.0+1c "*"
- lappend result [.sy get]
- after 0 {lappend result [.sy get]}
- after 1000 {lappend result [.sy get]}
- vwait result;vwait result
- return $result
+ .t1 insert end $txt
+ .t1 debug 1
+ set ge [winfo geometry .]
+ scan $ge "%dx%d+%d+%d" width height left top
+ update
+ .t1 yupdate
+ set negative 0
+ bind .t1 <<TextLineHeightsInvalid>> { if {%d < 0} {set negative 1} }
+ # Without the fix for bug 2677890, changing the width of the toplevel
+ # will launch recomputation of the line heights, but will produce negative
+ # number of still remaining outdated lines, which is obviously wrong.
+ # Thus we use this way to check for regression regarding bug 2677890,
+ # i.e. to check that the fix for this bug really is still in.
+ wm geometry . "[expr {$width * 2}]x$height+$left+$top"
+ update
+ .t1 yupdate
+ set negative
} -cleanup {
- destroy .t1 .sy
-} -result {{0.0 0.24} {0.0 0.24} {0.0 0.24} {0.0 0.24}}
+ destroy .t1
+} -result {0}
deleteWindows
option clear