diff options
Diffstat (limited to 'tests/textDisp.test')
-rw-r--r-- | tests/textDisp.test | 219 |
1 files changed, 117 insertions, 102 deletions
diff --git a/tests/textDisp.test b/tests/textDisp.test index f2d7047..c1cae00 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1,26 +1,39 @@ # This file is a Tcl script to test the code in the file tkTextDisp.c. # This file is organized in the standard fashion for Tcl tests. # -# Copyright (c) 1994 The Regents of the University of California. -# Copyright (c) 1994-1997 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. +# Copyright © 1994 The Regents of the University of California. +# Copyright © 1994-1997 Sun Microsystems, Inc. +# Copyright © 1998-1999 by Scriptics Corporation. # All rights reserved. -package require tcltest 2.1 +package require tcltest 2.2 eval tcltest::configure $argv tcltest::loadTestedCommands namespace import -force tcltest::test +testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}] +testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] + # Platform specific procedure for updating the text widget. if {[tk windowingsystem] == "aqua"} { proc updateText {} { update idletasks } + proc delay {} { + update idletasks + after 100 + update idletasks + } } else { proc updateText {} { update } + proc delay {} { + update + after 100 + update + } } # The procedure below is used as the scrolling command for the text; @@ -213,9 +226,9 @@ test textDisp-1.1 {GetStyle procedure, priorities and tab stops} { .t delete 1.0 end .t insert 1.0 "x\ty" .t tag delete x y z - .t tag configure x -tabs {50} + .t tag configure x -tabs 50 .t tag configure y -foreground black - .t tag configure z -tabs {70} + .t tag configure z -tabs 70 .t tag add x 1.0 1.end .t tag add y 1.0 1.end .t tag add z 1.0 1.end @@ -223,7 +236,7 @@ test textDisp-1.1 {GetStyle procedure, priorities and tab stops} { set x [lindex [.t bbox 1.2] 0] .t tag configure z -tabs {} lappend x [lindex [.t bbox 1.2] 0] - .t tag configure z -tabs {30} + .t tag configure z -tabs 30 .t tag raise x update idletasks lappend x [lindex [.t bbox 1.2] 0] @@ -275,7 +288,7 @@ test textDisp-2.5 {LayoutDLine, word wrap} {textfonts} { .t insert 1.0 "This isx some sample text for testing." list [.t bbox 1.13] [.t bbox 1.19] [.t bbox 1.20] [.t bbox 1.21] } [list [list 96 5 $fixedWidth $fixedHeight] [list 138 5 $fixedWidth $fixedHeight] [list 145 5 0 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] $fixedWidth $fixedHeight]] -test textDisp-2.6 {LayoutDLine, word wrap} { +test textDisp-2.6 {LayoutDLine, word wrap} failsOnUbuntu { .t configure -wrap word .t delete 1.0 end .t insert 1.0 "This isxxx some sample text for testing." @@ -494,7 +507,7 @@ test textDisp-2.24 {LayoutDLine, tabs, saving from first chunk} {textfonts} { .t tag add x 1.0 end .t tag add y 1.1 end lindex [.t bbox 1.3] 0 -} {75} +} 75 test textDisp-2.25 {LayoutDLine, tabs, breaking chunks at tabs} {textfonts} { .t delete 1.0 end .t tag delete x @@ -661,7 +674,7 @@ test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} { updateText set x } {8.0 {16.0 17.0 15.0 14.0 13.0 12.0 11.0 10.0 9.0 8.0} {8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0}} -test textDisp-4.8 {UpdateDisplayInfo, filling in extra vertical space} { +test textDisp-4.8 {UpdateDisplayInfo, filling in extra vertical space} failsOnXQuarz { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" .t yview 16.0 @@ -708,7 +721,7 @@ test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { .t yview moveto 1 updateText winfo ismapped .b -} {0} +} 0 .t configure -wrap word .t delete 1.0 end .t insert end "Line 1\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\nLine 7\n" @@ -724,7 +737,7 @@ test textDisp-4.13 {UpdateDisplayInfo, special handling for top/bottom lines} { updateText list $tk_textRelayout $tk_textRedraw } {{11.0 12.0 13.0} {4.0 10.0 11.0 12.0 13.0}} -test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} { +test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} failsOnXQuarz { .t tag remove x 1.0 end .t yview 1.0 updateText @@ -857,7 +870,7 @@ test textDisp-5.2 {DisplayDLine, line resizes during display} { } [list 30 30] .t configure -wrap char -test textDisp-6.1 {scrolling in DisplayText, scroll up} { +test textDisp-6.1 {scrolling in DisplayText, scroll up} failsOnXQuarz { .t delete 1.0 end .t insert 1.0 "Line 1" foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { @@ -1145,7 +1158,7 @@ test textDisp-8.6 {TkTextChanged} { updateText list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} -test textDisp-8.7 {TkTextChanged} { +test textDisp-8.7 {TkTextChanged} failsOnXQuarz { .t delete 1.0 end .t insert 1.0 "Line 1 is so long that it wraps around, two times" foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { @@ -1167,7 +1180,7 @@ test textDisp-8.8 {TkTextChanged} { updateText list $tk_textRelayout $tk_textRedraw } {2.0 2.0} -test textDisp-8.9 {TkTextChanged} { +test textDisp-8.9 {TkTextChanged} failsOnXQuarz { .t delete 1.0 end .t insert 1.0 "Line 1 is so long that it wraps around, two times" foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { @@ -1178,7 +1191,7 @@ test textDisp-8.9 {TkTextChanged} { updateText list $tk_textRelayout $tk_textRedraw } {{2.0 8.0} {2.0 8.0}} -test textDisp-8.10 {TkTextChanged} { +test textDisp-8.10 {TkTextChanged} failsOnUbuntu { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" @@ -1238,7 +1251,7 @@ test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} { update idletasks } {} -test textDisp-9.1 {TkTextRedrawTag} { +test textDisp-9.1 {TkTextRedrawTag} failsOnUbuntu { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" @@ -1256,7 +1269,7 @@ test textDisp-9.2 {TkTextRedrawTag} {textfonts} { updateText list $tk_textRelayout $tk_textRedraw } {{1.0 2.0 2.17} {1.0 2.0 2.17}} -test textDisp-9.3 {TkTextRedrawTag} { +test textDisp-9.3 {TkTextRedrawTag} failsOnUbuntu { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" @@ -1267,7 +1280,7 @@ test textDisp-9.3 {TkTextRedrawTag} { updateText list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} -test textDisp-9.4 {TkTextRedrawTag} { +test textDisp-9.4 {TkTextRedrawTag} failsOnUbuntu { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" @@ -1278,7 +1291,7 @@ test textDisp-9.4 {TkTextRedrawTag} { updateText list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} -test textDisp-9.5 {TkTextRedrawTag} { +test textDisp-9.5 {TkTextRedrawTag} {failsOnUbuntu failsOnXQuarz} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" @@ -1289,7 +1302,7 @@ test textDisp-9.5 {TkTextRedrawTag} { updateText list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} -test textDisp-9.6 {TkTextRedrawTag} { +test textDisp-9.6 {TkTextRedrawTag} failsOnUbuntu { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap" @@ -1300,7 +1313,7 @@ test textDisp-9.6 {TkTextRedrawTag} { updateText list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 3.0 3.20} {2.0 2.20 3.0 3.20 eof}} -test textDisp-9.7 {TkTextRedrawTag} { +test textDisp-9.7 {TkTextRedrawTag} failsOnUbuntu { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" @@ -1336,11 +1349,11 @@ test textDisp-9.10 {TkTextRedrawTag} { .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 1.0 2.0 updateText - set tk_textRedraw {none} + set tk_textRedraw none .t tag add big 1.3 1.5 updateText set tk_textRedraw -} {none} +} none test textDisp-9.11 {TkTextRedrawTag} { .t configure -wrap char .t delete 1.0 end @@ -1440,7 +1453,7 @@ test textDisp-11.1 {TkTextSetYView} { updateText .t index @0,0 } {30.0} -test textDisp-11.2 {TkTextSetYView} { +test textDisp-11.2 {TkTextSetYView} failsOnXQuarz { .t yview 30.0 updateText .t yview 32.0 @@ -1454,7 +1467,7 @@ test textDisp-11.3 {TkTextSetYView} { updateText list [.t index @0,0] $tk_textRedraw } {28.0 {28.0 29.0}} -test textDisp-11.4 {TkTextSetYView} { +test textDisp-11.4 {TkTextSetYView} failsOnXQuarz { .t yview 30.0 updateText .t yview 31.4 @@ -1485,7 +1498,7 @@ test textDisp-11.7 {TkTextSetYView} { updateText list [.t index @0,0] $tk_textRedraw } {21.0 {21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0}} -test textDisp-11.8 {TkTextSetYView} { +test textDisp-11.8 {TkTextSetYView} failsOnXQuarz { .t yview 30.0 updateText set tk_textRedraw {} @@ -1493,7 +1506,7 @@ test textDisp-11.8 {TkTextSetYView} { updateText list [.t index @0,0] $tk_textRedraw } {32.0 {40.0 41.0}} -test textDisp-11.9 {TkTextSetYView} { +test textDisp-11.9 {TkTextSetYView} failsOnXQuarz { .t yview 30.0 updateText set tk_textRedraw {} @@ -1517,7 +1530,7 @@ test textDisp-11.11 {TkTextSetYView} { updateText list [.t index @0,0] $tk_textRedraw } {191.0 {191.0 192.0 193.0 194.0 195.0 196.0}} -test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} { +test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} failsOnXQuarz { .t insert 10.0 "Long line with enough text to wrap\n" .t yview 1.0 updateText @@ -1818,7 +1831,7 @@ test textDisp-13.11 {TkTextSeeCmd procedure} {} { set res [.top2.t2 compare $ref == $new] destroy .top2 set res -} {0} +} 0 wm geom . {} .t configure -wrap none @@ -1858,7 +1871,7 @@ test textDisp-14.5 {TkTextXviewCmd procedure} { test textDisp-14.6 {TkTextXviewCmd procedure} { list [catch {.t xview moveto a} msg] $msg } {1 {expected floating-point number but got "a"}} -test textDisp-14.7 {TkTextXviewCmd procedure} { +test textDisp-14.7 {TkTextXviewCmd procedure} failsOnUbuntu { .t delete 1.0 end .t insert end xxxxxxxxx\n .t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n" @@ -1890,7 +1903,7 @@ test textDisp-14.11 {TkTextXviewCmd procedure} { } {1 {wrong # args: should be ".t xview scroll number pages|pixels|units"}} test textDisp-14.12 {TkTextXviewCmd procedure} { list [catch {.t xview scroll gorp units} msg] $msg -} {1 {expected integer but got "gorp"}} +} {1 {expected floating-point number but got "gorp"}} test textDisp-14.13 {TkTextXviewCmd procedure} { .t delete 1.0 end .t insert end xxxxxxxxx\n @@ -2007,7 +2020,7 @@ test textDisp-15.8 {Scrolling near end of window} { set res [.tf.f.t compare $newind > $refind] destroy .tf set res -} {1} +} 1 .t configure -wrap char .t delete 1.0 end @@ -2058,7 +2071,7 @@ test textDisp-16.9 {TkTextYviewCmd procedure, "moveto" option} { test textDisp-16.10 {TkTextYviewCmd procedure, "moveto" option} { list [catch {.t yview moveto gorp} msg] $msg } {1 {expected floating-point number but got "gorp"}} -test textDisp-16.11 {TkTextYviewCmd procedure, "moveto" option} { +test textDisp-16.11 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu { .t yview moveto 0.5 .t index @0,0 } {103.0} @@ -2070,21 +2083,21 @@ test textDisp-16.13 {TkTextYviewCmd procedure, "moveto" option} { .t yview moveto 1.1 .t index @0,0 } {191.0} -test textDisp-16.14 {TkTextYviewCmd procedure, "moveto" option} { +test textDisp-16.14 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu { .t yview moveto .75 .t index @0,0 } {151.60} -test textDisp-16.15 {TkTextYviewCmd procedure, "moveto" option} { +test textDisp-16.15 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu { .t yview moveto .752 .t index @0,0 } {151.60} -test textDisp-16.16 {TkTextYviewCmd procedure, "moveto" option} {textfonts} { +test textDisp-16.16 {TkTextYviewCmd procedure, "moveto" option} textfonts { set count [expr {5 * $bigHeight + 150 * $fixedHeight}] set extra [expr {0.04 * double($fixedDiff * 150) / double($count)}] .t yview moveto [expr {.753 - $extra}] .t index @0,0 } {151.60} -test textDisp-16.17 {TkTextYviewCmd procedure, "moveto" option} { +test textDisp-16.17 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu { .t yview moveto .755 .t index @0,0 } {151.80} @@ -2109,11 +2122,11 @@ test textDisp-16.20 {TkTextYviewCmd procedure, "scroll" option} { list [catch {.t yview scroll a b c} msg] $msg } {1 {wrong # args: should be ".t yview scroll number pages|pixels|units"}} test textDisp-16.21 {TkTextYviewCmd procedure, "scroll" option} { - list [catch {.t yview scroll badInt bogus} msg] $msg + list [catch {.t yview scroll bogus bogus} msg] $msg } {1 {bad argument "bogus": must be pages, pixels, or units}} test textDisp-16.21.2 {TkTextYviewCmd procedure, "scroll" option} { - list [catch {.t yview scroll badInt units} msg] $msg -} {1 {expected integer but got "badInt"}} + list [catch {.t yview scroll bogus units} msg] $msg +} {1 {expected floating-point number but got "bogus"}} test textDisp-16.22 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t yview 50.0 updateText @@ -2167,7 +2180,7 @@ test textDisp-16.28 {TkTextYviewCmd procedure, "scroll" option, forward pages} { incr res -1 } set res -} {102} +} 102 test textDisp-16.29 {TkTextYviewCmd procedure, "scroll" option, forward pages} { .t configure -height 1 updateText @@ -2248,7 +2261,7 @@ test textDisp-16.38 {TkTextYviewCmd procedure} { test textDisp-16.39 {TkTextYviewCmd procedure} { list [catch {.t yview scroll 1.3i pixels} msg] $msg } {0 {}} -test textDisp-16.40 {text count -xpixels} { +test textDisp-16.40 {text count -xpixels} failsOnUbuntu { set res {} lappend res [.t count -xpixels 1.0 1.5] \ [.t count -xpixels 1.5 1.0] \ @@ -2489,8 +2502,6 @@ test textDisp-18.8 {GetXView procedure} { catch {rename bgerror {}} catch {rename bogus {}} .t configure -xscrollcommand {} -yscrollcommand scroll - -.t configure -xscrollcommand {} -yscrollcommand scroll test textDisp-19.1 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end @@ -2562,7 +2573,7 @@ test textDisp-19.7 {GetYView procedure} { updateText set x $scrollInfo } {0.125 0.75} -test textDisp-19.8 {GetYView procedure} { +test textDisp-19.8 {GetYView procedure} failsOnUbuntu { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1" @@ -2635,66 +2646,66 @@ test textDisp-19.11 {GetYView procedure} { } {0.5 1.0} test textDisp-19.11.2 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 1.0 end -} {20} +} 20 test textDisp-19.11.3 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines end 1.0 -} {-20} +} -20 test textDisp-19.11.4 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 1.1 1.3 -} {0} +} 0 test textDisp-19.11.5 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 16.1 -} {0} +} 0 test textDisp-19.11.5.1 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 16.5 -} {0} +} 0 test textDisp-19.11.6 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 16.24 -} {1} +} 1 test textDisp-19.11.7 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 16.40 -} {2} +} 2 test textDisp-19.11.8 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines "16.0 displaylineend +1c" "16.0 lineend" -} {3} +} 3 test textDisp-19.11.9 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 "16.0 lineend" -} {4} +} 4 test textDisp-19.11.10 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 "16.0 +4displaylines" -} {4} +} 4 test textDisp-19.11.11 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 "16.0 +2displaylines" -} {2} +} 2 test textDisp-19.11.12 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines "16.0 +1displayline" "16.0 +2displaylines -1c" -} {0} +} 0 .t tag configure elide -elide 1 test textDisp-19.11.13 {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "16.0 +1displaylines" "16.0 +1displaylines +6c" .t count -displaylines 16.0 "16.0 +4displaylines" -} {4} +} 4 test textDisp-19.11.14 {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "16.0 +1displaylines" "16.0 +1displaylines displaylineend" .t count -displaylines 16.0 "16.0 +4displaylines" -} {4} +} 4 test textDisp-19.11.15 {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "16.0 +1displaylines" "16.0 +2displaylines" .t count -displaylines 16.0 "16.0 +4displaylines -1c" -} {3} +} 3 test textDisp-19.11.15a {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "16.0 +1displaylines" "16.0 +2displaylines" .t count -displaylines 16.0 "16.0 +4displaylines" -} {4} +} 4 test textDisp-19.11.16 {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "12.0" "14.0" .t count -displaylines 12.0 16.0 -} {2} +} 2 test textDisp-19.11.17 {TextWidgetCmd procedure, "index +displaylines"} { .t tag remove elide 1.0 end .t tag add elide "12.0" "14.0" @@ -2715,7 +2726,7 @@ test textDisp-19.11.19 {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "12.0" "16.0 +1displaylines" .t count -displaylines 12.0 17.0 -} {4} +} 4 test textDisp-19.11.20 {TextWidgetCmd procedure, "index +displaylines"} { .t tag remove elide 1.0 end .t tag add elide "12.0" "16.0 +1displaylines" @@ -2859,7 +2870,7 @@ test textDisp-19.16 {count -ypixels} { [.t count -ypixels 16.0 "16.0 displaylineend +1c"] \ [.t count -ypixels "16.0 +1 displaylines" "16.0 +4 displaylines +3c"] } [list [expr {260 + 20 * $fixedDiff}] [expr {260 + 20 * $fixedDiff}] $fixedHeight [expr {2*$fixedHeight}] $fixedHeight [expr {3*$fixedHeight}]] -test textDisp-19.17 {count -ypixels with indices in elided lines} { +test textDisp-19.17 {count -ypixels with indices in elided lines} {failsOnUbuntu failsOnXQuarz} { .t configure -wrap none .t delete 1.0 end for {set i 1} {$i < 100} {incr i} { @@ -2886,7 +2897,7 @@ test textDisp-19.17 {count -ypixels with indices in elided lines} { .t yview 35.0 lappend res [.t count -ypixels 5.0 25.0] } [list [expr {4 * $fixedHeight}] [expr {3 * $fixedHeight}] 0 0 0 0 0 0 [expr {5 * $fixedHeight}] [expr {- 5 * $fixedHeight}] [expr {2 * $fixedHeight}] [expr {3 * $fixedHeight}] [expr {5 * $fixedHeight}]] -test textDisp-19.18 {count -ypixels with indices in elided lines} { +test textDisp-19.18 {count -ypixels with indices in elided lines} {failsOnUbuntu failsOnXQuarz} { .t configure -wrap none .t delete 1.0 end for {set i 1} {$i < 100} {incr i} { @@ -2924,28 +2935,28 @@ for {set i 2} {$i <= 200} {incr i} { .t configure -wrap word .t delete 50.0 51.0 .t insert 50.0 "This is a long line, one that will wrap around twice.\n" -test textDisp-20.1 {FindDLine} { +test textDisp-20.1 {FindDLine} failsOnUbuntu { .t yview 48.0 list [.t dlineinfo 46.0] [.t dlineinfo 47.0] [.t dlineinfo 49.0] \ [.t dlineinfo 58.0] } [list {} {} [list 3 [expr {$fixedDiff + 16}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}] -test textDisp-20.2 {FindDLine} { +test textDisp-20.2 {FindDLine} failsOnUbuntu { .t yview 100.0 .t yview -pickplace 53.0 list [.t dlineinfo 50.0] [.t dlineinfo 50.14] [.t dlineinfo 50.21] } [list [list 3 [expr {-1 - $fixedDiff/2}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {-1 - $fixedDiff/2}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {12 + $fixedDiff/2}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]] -test textDisp-20.3 {FindDLine} { +test textDisp-20.3 {FindDLine} failsOnUbuntu { .t yview 100.0 .t yview 49.0 list [.t dlineinfo 50.0] [.t dlineinfo 50.24] [.t dlineinfo 57.0] } [list [list 3 [expr {$fixedDiff + 16}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {2*$fixedDiff + 29}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}] -test textDisp-20.4 {FindDLine} { +test textDisp-20.4 {FindDLine} failsOnUbuntu { .t yview 100.0 .t yview 42.0 list [.t dlineinfo 50.0] [.t dlineinfo 50.24] [.t dlineinfo 50.40] } [list [list 3 [expr {8*$fixedDiff + 107}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {9*$fixedDiff + 120}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}] .t config -wrap none -test textDisp-20.5 {FindDLine} { +test textDisp-20.5 {FindDLine} failsOnUbuntu { .t yview 100.0 .t yview 48.0 list [.t dlineinfo 50.0] [.t dlineinfo 50.20] [.t dlineinfo 50.40] @@ -2995,7 +3006,7 @@ set res [.tt.u count -displaylines 3.10 2.173] destroy .tt unset message set res -} {-1} +} -1 .t delete 1.0 end .t insert end "Line 1" @@ -3403,7 +3414,7 @@ test textDisp-24.24 {TkTextCharLayoutProc, justification and tabs} {textfonts} { .t tag add x 1.0 end list [.t bbox 1.0] [.t bbox 1.10] } [list [list 45 3 7 $fixedHeight] [list 94 3 7 $fixedHeight]] -test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints {textfonts} -setup { +test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints {textfonts failsOnXQuarz} -setup { text .tt -tabs {40 right} -wrap none -font $fixedFont pack .tt } -body { @@ -3482,7 +3493,7 @@ test textDisp-26.5 {AdjustForTab procedure, numeric alignment} { .t tag add y 1.2 .t tag add y 1.5 lindex [.t bbox 1.3] 0 -} {120} +} 120 test textDisp-26.6 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\t1,456.234 @@ -3491,7 +3502,7 @@ test textDisp-26.6 {AdjustForTab procedure, numeric alignment} { .t tag add x 1.0 end .t tag add y 1.2 lindex [.t bbox 1.7] 0 -} {120} +} 120 test textDisp-26.7 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\t1.456.234,7 @@ -3500,7 +3511,7 @@ test textDisp-26.7 {AdjustForTab procedure, numeric alignment} { .t tag add x 1.0 end .t tag add y 1.2 lindex [.t bbox 1.11] 0 -} {120} +} 120 test textDisp-26.8 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\ttest @@ -3509,7 +3520,7 @@ test textDisp-26.8 {AdjustForTab procedure, numeric alignment} { .t tag add x 1.0 end .t tag add y 1.2 lindex [.t bbox 1.6] 0 -} {120} +} 120 test textDisp-26.9 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\t1234 @@ -3518,7 +3529,7 @@ test textDisp-26.9 {AdjustForTab procedure, numeric alignment} { .t tag add x 1.0 end .t tag add y 1.2 lindex [.t bbox 1.6] 0 -} {120} +} 120 test textDisp-26.10 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\t1.234567 @@ -3527,7 +3538,7 @@ test textDisp-26.10 {AdjustForTab procedure, numeric alignment} { .t tag add x 1.0 end .t tag add y 1.5 lindex [.t bbox 1.3] 0 -} {120} +} 120 test textDisp-26.11 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\tx=1.234567 @@ -3537,7 +3548,7 @@ test textDisp-26.11 {AdjustForTab procedure, numeric alignment} { .t tag add y 1.7 .t tag add y 1.9 lindex [.t bbox 1.5] 0 -} {120} +} 120 test textDisp-26.12 {AdjustForTab procedure, adjusting chunks} { .t delete 1.0 end .t insert 1.0 a\tx1.234567 @@ -3550,7 +3561,7 @@ test textDisp-26.12 {AdjustForTab procedure, adjusting chunks} { .t window create 1.3 -window .b updateText lindex [.t bbox 1.5] 0 -} {120} +} 120 test textDisp-26.13 {AdjustForTab procedure, not enough space} {textfonts} { .t delete 1.0 end .t insert 1.0 "abc\txyz\tqrs\txyz\t0" @@ -3707,7 +3718,7 @@ test textDisp-27.7.2 {SizeOfTab procedure, fractional tab interpolation problem} .t configure -tabs $precisetab updateText expr {[lindex $res 0] - [lindex [.t bbox 1.20] 0]} -} {0} +} 0 .t configure -wrap char -tabs {} -width 20 updateText @@ -3723,7 +3734,7 @@ test textDisp-27.9 {SizeOfTab procedure, left alignment} {textfonts} { .t delete 1.0 end .t insert 1.0 a\txyzzyabc .t tag delete x - .t tag configure x -tabs {120} + .t tag configure x -tabs 120 .t tag add x 1.0 end list [.t bbox 1.3] [.t bbox 1.4] } [list [list 131 5 13 $fixedHeight] [list 4 [expr {$fixedDiff + 18}] 7 $fixedHeight]] @@ -3739,7 +3750,7 @@ test textDisp-27.11 {SizeOfTab procedure, making tabs at least as wide as a spac .t delete 1.0 end .t insert 1.0 abc\tdefghijklmnopqrst .t tag delete x - .t tag configure x -tabs {120} + .t tag configure x -tabs 120 .t tag add x 1.0 end list [.t bbox 1.5] [.t bbox 1.6] } [list [list 131 5 13 $fixedHeight] [list 4 [expr {$fixedDiff + 18}] 7 $fixedHeight]] @@ -3912,20 +3923,20 @@ test textDisp-30.1 {elidden text joining multiple logical lines} { .t2.t tag configure elidden -elide 1 -background red .t2.t tag add elidden 1.2 3.2 .t2.t count -displaylines 1.0 end -} {1} +} 1 test textDisp-30.2 {elidden text joining multiple logical lines} { .t2.t delete 1.0 end .t2.t insert 1.0 "1111\n2222\n3333" .t2.t tag configure elidden -elide 1 -background red .t2.t tag add elidden 1.2 2.2 .t2.t count -displaylines 1.0 end -} {2} +} 2 catch {destroy .t2} .t configure -height 1 updateText -test textDisp-31.1 {line embedded window height update} { +test textDisp-31.1 {line embedded window height update} failsOnUbuntu { set res {} .t delete 1.0 end .t insert end "abcd\nefgh\nijkl\nmnop\nqrst\nuvwx\nyx" @@ -3938,7 +3949,7 @@ test textDisp-31.1 {line embedded window height update} { set res } [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 6}] [expr {$fixedHeight * 7}]] -test textDisp-31.2 {line update index shifting} { +test textDisp-31.2 {line update index shifting} failsOnUbuntu { set res {} .t.f configure -height 100 updateText @@ -3955,7 +3966,7 @@ test textDisp-31.2 {line update index shifting} { set res } [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]] -test textDisp-31.3 {line update index shifting} { +test textDisp-31.3 {line update index shifting} failsOnUbuntu { # Should do exactly the same as the above, as long # as we are correctly tagging the correct lines for # recalculation. The 'update' and 'delay' must be @@ -3969,12 +3980,12 @@ test textDisp-31.3 {line update index shifting} { .t insert 1.0 "abc\n" .t insert 1.0 "abc\n" lappend res [.t count -ypixels 1.0 end] - update ; after 1000 ; update + delay lappend res [.t count -ypixels 1.0 end] .t.f configure -height 100 .t delete 1.0 3.0 lappend res [.t count -ypixels 1.0 end] - update ; after 1000 ; update + delay lappend res [.t count -ypixels 1.0 end] set res } [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]] @@ -3992,7 +4003,7 @@ test textDisp-31.4 {line embedded image height update} { set res } [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 6}] [expr {$fixedHeight * 7}]] -test textDisp-31.5 {line update index shifting} { +test textDisp-31.5 {line update index shifting} failsOnUbuntu { set res {} textest configure -height 100 updateText @@ -4009,7 +4020,7 @@ test textDisp-31.5 {line update index shifting} { set res } [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]] -test textDisp-31.6 {line update index shifting} { +test textDisp-31.6 {line update index shifting} failsOnUbuntu { # Should do exactly the same as the above, as long # as we are correctly tagging the correct lines for # recalculation. The 'update' and 'delay' must be @@ -4022,12 +4033,12 @@ test textDisp-31.6 {line update index shifting} { .t insert 1.0 "abc\n" .t insert 1.0 "abc\n" lappend res [.t count -ypixels 1.0 end] - update ; after 1000 ; update + delay lappend res [.t count -ypixels 1.0 end] textest configure -height 100 .t delete 1.0 3.0 lappend res [.t count -ypixels 1.0 end] - update ; after 1000 ; update + delay lappend res [.t count -ypixels 1.0 end] set res } [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]] @@ -4044,11 +4055,11 @@ test textDisp-31.7 {line update index shifting, elided} { .t tag configure elide -elide 1 .t tag add elide 1.3 2.1 lappend res [.t count -ypixels 1.0 end] - update ; after 1000 ; update + delay lappend res [.t count -ypixels 1.0 end] .t delete 1.0 3.0 lappend res [.t count -ypixels 1.0 end] - update ; after 1000 ; update + delay lappend res [.t count -ypixels 1.0 end] set res } [list [expr {$fixedHeight * 1}] [expr {$fixedHeight * 3}] [expr {$fixedHeight * 3}] [expr {$fixedHeight * 2}] [expr {$fixedHeight * 1}] [expr {$fixedHeight * 1}]] @@ -4183,6 +4194,7 @@ test textDisp-32.3 "NULL undisplayProc problems: #1791052" -setup { test textDisp-33.0 {one line longer than fits in the widget} { pack [text .tt -wrap char] + updateText .tt insert 1.0 [string repeat "more wrap + " 300] updateText .tt see 1.0 @@ -4191,6 +4203,7 @@ test textDisp-33.0 {one line longer than fits in the widget} { test textDisp-33.1 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] + updateText .tt insert 1.0 [string repeat "more wrap + " 300] updateText .tt yview "1.0 +1 displaylines" @@ -4204,12 +4217,14 @@ test textDisp-33.2 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] .tt debug 1 + updateText set tk_textHeightCalc "" + set timer [after 200 lappend tk_textHeightCalc "Timed out"] .tt insert 1.0 [string repeat "more wrap + " 1] - after 100 ; update idletasks - # Nothing should have been recalculated. + vwait tk_textHeightCalc + after cancel $timer set tk_textHeightCalc -} {} +} {1.0} test textDisp-33.3 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] @@ -4222,7 +4237,7 @@ test textDisp-33.3 {one line longer than fits in the widget} { # Each line should have been recalculated just once .tt debug 0 expr {[llength $tk_textHeightCalc] == [.tt count -displaylines 1.0 end]} -} {1} +} 1 test textDisp-33.4 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] @@ -4293,7 +4308,7 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { set negative } -cleanup { destroy .t1 -} -result {0} +} -result 0 test textDisp-35.1 {Init value of charHeight - Dancing scrollbar bug 1499165} -setup { pack [text .t1] -fill both -expand y -side left |