diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-10-25 21:06:25 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-10-25 21:06:25 (GMT) |
| commit | 0d5336db012f45753abace489f18f0ca299c6961 (patch) | |
| tree | b1bf3280a9046df99226158978502eeb26f5b0a3 /tests | |
| parent | e97381a6d921de403516d5b761539a450f4af83c (diff) | |
| parent | 1320b8a2a9c1269a345d44d673a7a35707fbbe9c (diff) | |
| download | tk-core-tip-626.zip tk-core-tip-626.tar.gz tk-core-tip-626.tar.bz2 | |
Merge 9.0core-tip-626
Diffstat (limited to 'tests')
83 files changed, 4446 insertions, 4074 deletions
diff --git a/tests/bell.test b/tests/bell.test index 2f5efee..935ce8f 100644 --- a/tests/bell.test +++ b/tests/bell.test @@ -12,19 +12,19 @@ tcltest::loadTestedCommands test bell-1.1 {bell command} -body { bell a -} -returnCodes {error} -result {bad option "a": must be -displayof or -nice} +} -returnCodes error -result {bad option "a": must be -displayof or -nice} test bell-1.2 {bell command} -body { bell a b -} -returnCodes {error} -result {bad option "a": must be -displayof or -nice} +} -returnCodes error -result {bad option "a": must be -displayof or -nice} test bell-1.3 {bell command} -body { bell -displayof gorp -} -returnCodes {error} -result {bad window path name "gorp"} +} -returnCodes error -result {bad window path name "gorp"} test bell-1.4 {bell command} -body { bell -nice -displayof -} -returnCodes {error} -result {wrong # args: should be "bell ?-displayof window? ?-nice?"} +} -returnCodes error -result {wrong # args: should be "bell ?-displayof window? ?-nice?"} test bell-1.5 {bell command} -body { bell -nice -nice -nice @@ -36,7 +36,7 @@ test bell-1.6 {bell command} -body { test bell-1.7 {bell command} -body { bell -nice -displayof . -nice -} -returnCodes {error} -result {wrong # args: should be "bell ?-displayof window? ?-nice?"} +} -returnCodes error -result {wrong # args: should be "bell ?-displayof window? ?-nice?"} test bell-1.8 {bell command} -body { puts "Bell should ring now ..." diff --git a/tests/bgerror.test b/tests/bgerror.test index bd38310..eda8ba6 100644 --- a/tests/bgerror.test +++ b/tests/bgerror.test @@ -13,8 +13,8 @@ tcltest::loadTestedCommands test bgerror-1.1 {bgerror / tkerror compat} -setup { set errRes {} proc tkerror {err} { - global errRes; - set errRes $err; + global errRes; + set errRes $err; } } -body { after 0 {error err1} @@ -27,8 +27,8 @@ test bgerror-1.1 {bgerror / tkerror compat} -setup { test bgerror-1.2 {bgerror / tkerror compat / accumulation} -setup { set errRes {} proc tkerror {err} { - global errRes; - lappend errRes $err; + global errRes; + lappend errRes $err; } } -body { after 0 {error err1} @@ -43,9 +43,9 @@ test bgerror-1.2 {bgerror / tkerror compat / accumulation} -setup { test bgerror-1.3 {bgerror / tkerror compat / accumulation / break} -setup { set errRes {} proc tkerror {err} { - global errRes; - lappend errRes $err; - return -code break "skip!"; + global errRes; + lappend errRes $err; + return -code break "skip!"; } } -body { after 0 {error err1} diff --git a/tests/bind.test b/tests/bind.test index 5421e62..b536d35 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -342,11 +342,11 @@ test bind-9.2 {Tk_DeleteBinding procedure} -setup { } -body { frame .t.f -class Test -width 150 -height 100 foreach i {a b c d} { - bind .t.f $i "binding for $i" + bind .t.f $i "binding for $i" } foreach i {b d a c} { - bind .t.f $i {} - lappend result [lsort [bind .t.f]] + bind .t.f $i {} + lappend result [lsort [bind .t.f]] } return $result } -cleanup { @@ -357,11 +357,11 @@ test bind-9.3 {Tk_DeleteBinding procedure} -setup { } -body { frame .t.f -class Test -width 150 -height 100 foreach i {<Button-1> <Meta-Button-1> <Control-Button-1> <Double-Alt-Button-1>} { - bind .t.f $i "binding for $i" + bind .t.f $i "binding for $i" } foreach i {<Control-Button-1> <Double-Alt-Button-1> <Button-1> <Meta-Button-1>} { - bind .t.f $i {} - lappend result [lsort [bind .t.f]] + bind .t.f $i {} + lappend result [lsort [bind .t.f]] } return $result } -cleanup { @@ -385,7 +385,7 @@ test bind-10.2 {Tk_GetBinding procedure} -body { test bind-11.1 {Tk_GetAllBindings procedure} -body { frame .t.f foreach i "! a \\\{ ~ <Delete> <space> <<Paste>> <Tab> <Linefeed> <Key-<> <Meta-a> <Â>" { - bind .t.f $i Test + bind .t.f $i Test } lsort [bind .t.f] } -cleanup { @@ -394,7 +394,7 @@ test bind-11.1 {Tk_GetAllBindings procedure} -body { test bind-11.2 {Tk_GetAllBindings procedure} -body { frame .t.f foreach i "<Double-Button-1> <Triple-Button-1> <Meta-Control-a> <Double-Alt-Enter> <Button-1>" { - bind .t.f $i Test + bind .t.f $i Test } lsort [bind .t.f] } -cleanup { @@ -403,7 +403,7 @@ test bind-11.2 {Tk_GetAllBindings procedure} -body { test bind-11.3 {Tk_GetAllBindings procedure} -body { frame .t.f foreach i "<Double-Triple-Button-1> abcd a<Leave>b" { - bind .t.f $i Test + bind .t.f $i Test } lsort [bind .t.f] } -cleanup { @@ -418,7 +418,7 @@ test bind-12.1 {Tk_DeleteAllBindings procedure} -body { test bind-12.2 {Tk_DeleteAllBindings procedure} -body { frame .t.f -class Test -width 150 -height 100 foreach i "a b c <Meta-Button-1> <Alt-a> <Control-a>" { - bind .t.f $i x + bind .t.f $i x } destroy .t.f } -result {} @@ -490,8 +490,8 @@ test bind-13.3 {Tk_BindEvent procedure} -setup { (command bound to event)}} test bind-13.4 {Tk_BindEvent procedure} -setup { proc foo {} { - set x 44 - event generate .t.f <:> + set x 44 + event generate .t.f <:> } frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -936,7 +936,7 @@ test bind-13.33 {Tk_BindEvent procedure: many C bindings cause realloc} -setup { } -body { bindtags .t.f {a b c d e f g h i j k l m n o p} foreach p [bindtags .t.f] { - bind $p <Button-1> "lappend x $p" + bind $p <Button-1> "lappend x $p" } event generate .t.f <Button-1> return $x @@ -1019,8 +1019,8 @@ test bind-13.43 {Tk_BindEvent procedure: break in script} -setup { } -result {b1} test bind-13.45 {Tk_BindEvent procedure: error in script} -setup { proc bgerror msg { - global x - lappend x $msg + global x + lappend x $msg } frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -6070,8 +6070,8 @@ test bind-28.15 {keysym names, Emoji} -body { test bind-29.1 {Tcl_BackgroundError procedure} -setup { proc bgerror msg { - global x errorInfo - set x [list $msg $errorInfo] + global x errorInfo + set x [list $msg $errorInfo] } frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -6094,12 +6094,12 @@ test bind-29.1 {Tcl_BackgroundError procedure} -setup { test bind-29.2 {Tcl_BackgroundError procedure} -setup { proc do {} { - event generate .t.f <Button> - event generate .t.f <ButtonRelease> + event generate .t.f <Button> + event generate .t.f <ButtonRelease> } proc bgerror msg { - global x errorInfo - set x [list $msg $errorInfo] + global x errorInfo + set x [list $msg $errorInfo] } frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -6284,7 +6284,7 @@ test bind-32.2 {detection of double click should not fail} -setup { # that used an event ring overflowed, and the double click was not detected. # But new implementation should work properly. for {set i 0} {$i < 1000} {incr i} { - event generate .t.f <Expose> + event generate .t.f <Expose> } event generate .t.f <Button-1> event generate .t.f <ButtonRelease-1> @@ -6857,9 +6857,9 @@ test bind-34.1 {-warp works relatively to a window} -setup { # pointer should have moved the same amount as the window moved set res 1 foreach pos1 $pointerPos1 pos2 $pointerPos2 { - if {$pos1 != [expr {$pos2 - 400}]} { - set res [list $pointerPos1 $pointerPos2] - } + if {$pos1 != ($pos2 - 400)} { + set res [list $pointerPos1 $pointerPos2] + } } set res } -cleanup { @@ -6883,31 +6883,31 @@ test bind-34.3 {-warp works with null or negative coordinates} -setup { # a hot spot (which would trigger the corresponding action as an # unwanted effect) but will warp the pointer to the hot spot limit only. if {[tk windowingsystem] eq "x11"} { - set halo 1 + set halo 1 } else { - set halo 0 + set halo 0 } set res {} } -body { event generate {} <Motion> -x 0 -y 0 -warp 1 controlPointerWarpTiming foreach dim [winfo pointerxy .] { - if {$dim <= $halo} { - lappend res ok - } else { - lappend res $dim - } + if {$dim <= $halo} { + lappend res ok + } else { + lappend res $dim + } } event generate {} <Motion> -x 100 -y 100 -warp 1 controlPointerWarpTiming event generate {} <Motion> -x -1 -y -1 -warp 1 controlPointerWarpTiming foreach dim [winfo pointerxy .] { - if {$dim <= $halo} { - lappend res ok - } else { - lappend res $dim - } + if {$dim <= $halo} { + lappend res ok + } else { + lappend res $dim + } } set res } -cleanup { @@ -6927,7 +6927,7 @@ proc testKey {window event type mods} { update event generate $window $event if {$keyInfo == {}} { - vwait keyInfo + vwait keyInfo } set save $keyInfo set keyInfo {} @@ -6937,7 +6937,7 @@ proc testKey {window event type mods} { } eval $injectcmd if {$keyInfo == {}} { - vwait keyInfo + vwait keyInfo } if {$save != $keyInfo} { return "[format "0x%x" $numericKeysym] ($mods): $save != $keyInfo" @@ -7051,7 +7051,7 @@ test bind-36.1 {pointer warp with grab on toplevel, bug [e3888d5820]} -setup { grab release .top wm geometry .top 200x200+300+300 label .top.l -height 5 -width 20 -highlightthickness 2 \ - -highlightbackground black -bg yellow -text "My label" + -highlightbackground black -bg yellow -text "My label" pack .top.l -side bottom update # On KDE/Plasma _with_the_Aurorae_theme_ (at least), setting up the toplevel @@ -7073,7 +7073,7 @@ test bind-36.1 {pointer warp with grab on toplevel, bug [e3888d5820]} -setup { # success if the coords are the same with or without the grab, and if they # are at (10,10) inside the label widget as requested by the warping expr {$x1==$x2 && $y1==$y2 && $x1==[winfo rootx .top.l]+10 \ - && $y1==[winfo rooty .top.l]+10} + && $y1==[winfo rooty .top.l]+10} } -cleanup { destroy .top unset x1 y1 x2 y2 diff --git a/tests/busy.test b/tests/busy.test index e4f5165..f535bfc 100644 --- a/tests/busy.test +++ b/tests/busy.test @@ -83,7 +83,7 @@ test busy-2.8 {tk busy hold non existing window} -body { test busy-2.9 {tk busy hold (shortcut) non existing window} -body { tk busy .f update -} -returnCodes {error} -result {bad window path name ".f"} +} -returnCodes error -result {bad window path name ".f"} test busy-2.10 {tk busy hold root window with cursor} -body { set res [tk busy hold . -cursor arrow] update @@ -138,7 +138,7 @@ test busy-3.4 {tk busy cget non-busy window} -setup { tk busy cget .f -cursor } -cleanup { destroy .f -} -returnCodes error -result {can't find busy window ".f"} +} -returnCodes error -result {cannot find busy window ".f"} test busy-3.5 {tk busy cget invalid option} -setup { pack [frame .f] tk busy hold .f @@ -194,7 +194,7 @@ test busy-4.3 {tk busy configure non-busy window} -setup { tk busy configure .f } -cleanup { destroy .f -} -returnCodes error -result {can't find busy window ".f"} +} -returnCodes error -result {cannot find busy window ".f"} test busy-4.4 {tk busy configure} -constraints {nonwin} -setup { pack [frame .f] @@ -332,7 +332,7 @@ test busy-5.3 {tk busy forget non busy window} -setup { tk busy forget .f } -cleanup { destroy .f -} -returnCodes error -result {can't find busy window ".f"} +} -returnCodes error -result {cannot find busy window ".f"} test busy-5.4 {tk busy forget window} -setup { pack [frame .f] tk busy hold .f diff --git a/tests/button.test b/tests/button.test index 3479fc0..c60750a 100644 --- a/tests/button.test +++ b/tests/button.test @@ -35,7 +35,7 @@ test button-1.2 {configuration option: "activebackground" for label} -setup { .l configure -activebackground non-existent } -cleanup { destroy .l -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.3 {configuration option: "activebackground" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -54,7 +54,7 @@ test button-1.4 {configuration option: "activebackground" for button} -setup { .b configure -activebackground non-existent } -cleanup { destroy .b -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.5 {configuration option: "activebackground" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -73,7 +73,7 @@ test button-1.6 {configuration option: "activebackground" for checkbutton} -setu .c configure -activebackground non-existent } -cleanup { destroy .c -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.7 {configuration option: "activebackground" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -92,7 +92,7 @@ test button-1.8 {configuration option: "activebackground" for radiobutton} -setu .r configure -activebackground non-existent } -cleanup { destroy .r -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.9 {configuration option: "activeforeground" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -112,7 +112,7 @@ test button-1.10 {configuration option: "activeforeground" for label} -setup { .l configure -activeforeground non-existent } -cleanup { destroy .l -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.11 {configuration option: "activeforeground" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -131,7 +131,7 @@ test button-1.12 {configuration option: "activeforeground" for button} -setup { .b configure -activeforeground non-existent } -cleanup { destroy .b -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.13 {configuration option: "activeforeground" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -150,7 +150,7 @@ test button-1.14 {configuration option: "activeforeground" for checkbutton} -set .c configure -activeforeground non-existent } -cleanup { destroy .c -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.15 {configuration option: "activeforeground" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -169,7 +169,7 @@ test button-1.16 {configuration option: "activeforeground" for radiobutton} -set .r configure -activeforeground non-existent } -cleanup { destroy .r -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.17 {configuration option: "anchor" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -189,7 +189,7 @@ test button-1.18 {configuration option: "anchor" for label} -setup { .l configure -anchor bogus } -cleanup { destroy .l -} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} +} -returnCodes error -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} test button-1.19 {configuration option: "anchor" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -208,7 +208,7 @@ test button-1.20 {configuration option: "anchor" for button} -setup { .b configure -anchor bogus } -cleanup { destroy .b -} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} +} -returnCodes error -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} test button-1.21 {configuration option: "anchor" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -227,7 +227,7 @@ test button-1.22 {configuration option: "anchor" for checkbutton} -setup { .c configure -anchor bogus } -cleanup { destroy .c -} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} +} -returnCodes error -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} test button-1.23 {configuration option: "anchor" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -246,7 +246,7 @@ test button-1.24 {configuration option: "anchor" for radiobutton} -setup { .r configure -anchor bogus } -cleanup { destroy .r -} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} +} -returnCodes error -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} test button-1.25 {configuration option: "background" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -266,7 +266,7 @@ test button-1.26 {configuration option: "background" for label} -setup { .l configure -background non-existent } -cleanup { destroy .l -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.27 {configuration option: "background" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -285,7 +285,7 @@ test button-1.28 {configuration option: "background" for button} -setup { .b configure -background non-existent } -cleanup { destroy .b -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.29 {configuration option: "background" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -304,7 +304,7 @@ test button-1.30 {configuration option: "background" for checkbutton} -setup { .c configure -background non-existent } -cleanup { destroy .c -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.31 {configuration option: "background" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -323,7 +323,7 @@ test button-1.32 {configuration option: "background" for radiobutton} -setup { .r configure -background non-existent } -cleanup { destroy .r -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.33 {configuration option: "bd" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -343,7 +343,7 @@ test button-1.34 {configuration option: "bd" for label} -setup { .l configure -bd badValue } -cleanup { destroy .l -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.35 {configuration option: "bd" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -362,7 +362,7 @@ test button-1.36 {configuration option: "bd" for button} -setup { .b configure -bd badValue } -cleanup { destroy .b -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.37 {configuration option: "bd" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -381,7 +381,7 @@ test button-1.38 {configuration option: "bd" for checkbutton} -setup { .c configure -bd badValue } -cleanup { destroy .c -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.39 {configuration option: "bd" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -400,7 +400,7 @@ test button-1.40 {configuration option: "bd" for radiobutton} -setup { .r configure -bd badValue } -cleanup { destroy .r -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.41 {configuration option: "bg" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -420,7 +420,7 @@ test button-1.42 {configuration option: "bg" for label} -setup { .l configure -bg non-existent } -cleanup { destroy .l -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.43 {configuration option: "bg" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -439,7 +439,7 @@ test button-1.44 {configuration option: "bg" for button} -setup { .b configure -bg non-existent } -cleanup { destroy .b -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.45 {configuration option: "bg" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -458,7 +458,7 @@ test button-1.46 {configuration option: "bg" for checkbutton} -setup { .c configure -bg non-existent } -cleanup { destroy .c -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.47 {configuration option: "bg" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -477,7 +477,7 @@ test button-1.48 {configuration option: "bg" for radiobutton} -setup { .r configure -bg non-existent } -cleanup { destroy .r -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.49 {configuration option: "bitmap" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -497,7 +497,7 @@ test button-1.50 {configuration option: "bitmap" for label} -setup { .l configure -bitmap badValue } -cleanup { destroy .l -} -returnCodes {error} -result {bitmap "badValue" not defined} +} -returnCodes error -result {bitmap "badValue" not defined} test button-1.51 {configuration option: "bitmap" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -516,7 +516,7 @@ test button-1.52 {configuration option: "bitmap" for button} -setup { .b configure -bitmap badValue } -cleanup { destroy .b -} -returnCodes {error} -result {bitmap "badValue" not defined} +} -returnCodes error -result {bitmap "badValue" not defined} test button-1.53 {configuration option: "bitmap" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -535,7 +535,7 @@ test button-1.54 {configuration option: "bitmap" for checkbutton} -setup { .c configure -bitmap badValue } -cleanup { destroy .c -} -returnCodes {error} -result {bitmap "badValue" not defined} +} -returnCodes error -result {bitmap "badValue" not defined} test button-1.55 {configuration option: "bitmap" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -554,7 +554,7 @@ test button-1.56 {configuration option: "bitmap" for radiobutton} -setup { .r configure -bitmap badValue } -cleanup { destroy .r -} -returnCodes {error} -result {bitmap "badValue" not defined} +} -returnCodes error -result {bitmap "badValue" not defined} test button-1.57 {configuration option: "borderwidth" for label} -setup { label .l -highlightthickness 2 -font {Helvetica -12 bold} @@ -574,7 +574,7 @@ test button-1.58 {configuration option: "borderwidth" for label} -setup { .l configure -borderwidth badValue } -cleanup { destroy .l -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.59 {configuration option: "borderwidth" for button} -setup { button .b -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -593,7 +593,7 @@ test button-1.60 {configuration option: "borderwidth" for button} -setup { .b configure -borderwidth badValue } -cleanup { destroy .b -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.61 {configuration option: "borderwidth" for checkbutton} -setup { checkbutton .c -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -612,7 +612,7 @@ test button-1.62 {configuration option: "borderwidth" for checkbutton} -setup { .c configure -borderwidth badValue } -cleanup { destroy .c -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.63 {configuration option: "borderwidth" for radiobutton} -setup { radiobutton .r -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -631,7 +631,7 @@ test button-1.64 {configuration option: "borderwidth" for radiobutton} -setup { .r configure -borderwidth badValue } -cleanup { destroy .r -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.65 {configuration option: "command" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -692,7 +692,7 @@ test button-1.70 {configuration option: "compound" for label} -setup { .l configure -compound bogus } -cleanup { destroy .l -} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top} +} -returnCodes error -result {bad compound "bogus": must be bottom, center, left, none, right, or top} test button-1.71 {configuration option: "compound" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -711,7 +711,7 @@ test button-1.72 {configuration option: "compound" for button} -setup { .b configure -compound bogus } -cleanup { destroy .b -} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top} +} -returnCodes error -result {bad compound "bogus": must be bottom, center, left, none, right, or top} test button-1.73 {configuration option: "compound" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -730,7 +730,7 @@ test button-1.74 {configuration option: "compound" for checkbutton} -setup { .c configure -compound bogus } -cleanup { destroy .c -} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top} +} -returnCodes error -result {bad compound "bogus": must be bottom, center, left, none, right, or top} test button-1.75 {configuration option: "compound" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -749,7 +749,7 @@ test button-1.76 {configuration option: "compound" for radiobutton} -setup { .r configure -compound bogus } -cleanup { destroy .r -} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top} +} -returnCodes error -result {bad compound "bogus": must be bottom, center, left, none, right, or top} test button-1.77 {configuration option: "cursor" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -769,7 +769,7 @@ test button-1.78 {configuration option: "cursor" for label} -setup { .l configure -cursor badValue } -cleanup { destroy .l -} -returnCodes {error} -result {bad cursor spec "badValue"} +} -returnCodes error -result {bad cursor spec "badValue"} test button-1.79 {configuration option: "cursor" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -788,7 +788,7 @@ test button-1.80 {configuration option: "cursor" for button} -setup { .b configure -cursor badValue } -cleanup { destroy .b -} -returnCodes {error} -result {bad cursor spec "badValue"} +} -returnCodes error -result {bad cursor spec "badValue"} test button-1.81 {configuration option: "cursor" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -807,7 +807,7 @@ test button-1.82 {configuration option: "cursor" for checkbutton} -setup { .c configure -cursor badValue } -cleanup { destroy .c -} -returnCodes {error} -result {bad cursor spec "badValue"} +} -returnCodes error -result {bad cursor spec "badValue"} test button-1.83 {configuration option: "cursor" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -826,7 +826,7 @@ test button-1.84 {configuration option: "cursor" for radiobutton} -setup { .r configure -cursor badValue } -cleanup { destroy .r -} -returnCodes {error} -result {bad cursor spec "badValue"} +} -returnCodes error -result {bad cursor spec "badValue"} test button-1.85 {configuration option: "default" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -846,7 +846,7 @@ test button-1.86 {configuration option: "default" for button} -setup { .b configure -default huh? } -cleanup { destroy .b -} -returnCodes {error} -result {bad default "huh?": must be active, disabled, or normal} +} -returnCodes error -result {bad default "huh?": must be active, disabled, or normal} test button-1.87 {configuration option: "disabledforeground" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -866,7 +866,7 @@ test button-1.88 {configuration option: "disabledforeground" for label} -setup { .l configure -disabledforeground non-existent } -cleanup { destroy .l -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.89 {configuration option: "disabledforeground" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -885,7 +885,7 @@ test button-1.90 {configuration option: "disabledforeground" for button} -setup .b configure -disabledforeground non-existent } -cleanup { destroy .b -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.91 {configuration option: "disabledforeground" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -904,7 +904,7 @@ test button-1.92 {configuration option: "disabledforeground" for checkbutton} -s .c configure -disabledforeground non-existent } -cleanup { destroy .c -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.93 {configuration option: "disabledforeground" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -923,7 +923,7 @@ test button-1.94 {configuration option: "disabledforeground" for radiobutton} -s .r configure -disabledforeground non-existent } -cleanup { destroy .r -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.95 {configuration option: "fg" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -943,7 +943,7 @@ test button-1.96 {configuration option: "fg" for label} -setup { .l configure -fg non-existent } -cleanup { destroy .l -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.97 {configuration option: "fg" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -962,7 +962,7 @@ test button-1.98 {configuration option: "fg" for button} -setup { .b configure -fg non-existent } -cleanup { destroy .b -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.99 {configuration option: "fg" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -981,7 +981,7 @@ test button-1.100 {configuration option: "fg" for checkbutton} -setup { .c configure -fg non-existent } -cleanup { destroy .c -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.101 {configuration option: "fg" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1000,7 +1000,7 @@ test button-1.102 {configuration option: "fg" for radiobutton} -setup { .r configure -fg non-existent } -cleanup { destroy .r -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.103 {configuration option: "font" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 @@ -1020,7 +1020,7 @@ test button-1.104 {configuration option: "activebackground" for label} -setup { .l configure -font {} } -cleanup { destroy .l -} -returnCodes {error} -result {font "" doesn't exist} +} -returnCodes error -result {font "" does not exist} test button-1.105 {configuration option: "font" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 pack .b @@ -1039,7 +1039,7 @@ test button-1.106 {configuration option: "activebackground" for button} -setup { .b configure -font {} } -cleanup { destroy .b -} -returnCodes {error} -result {font "" doesn't exist} +} -returnCodes error -result {font "" does not exist} test button-1.107 {configuration option: "font" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 pack .c @@ -1058,7 +1058,7 @@ test button-1.108 {configuration option: "activebackground" for checkbutton} -se .c configure -font {} } -cleanup { destroy .c -} -returnCodes {error} -result {font "" doesn't exist} +} -returnCodes error -result {font "" does not exist} test button-1.109 {configuration option: "font" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 pack .r @@ -1077,7 +1077,7 @@ test button-1.110 {configuration option: "activebackground" for radiobutton} -se .r configure -font {} } -cleanup { destroy .r -} -returnCodes {error} -result {font "" doesn't exist} +} -returnCodes error -result {font "" does not exist} test button-1.111 {configuration option: "foreground" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1097,7 +1097,7 @@ test button-1.112 {configuration option: "foreground" for label} -setup { .l configure -foreground non-existent } -cleanup { destroy .l -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.113 {configuration option: "foreground" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -1116,7 +1116,7 @@ test button-1.114 {configuration option: "foreground" for button} -setup { .b configure -foreground non-existent } -cleanup { destroy .b -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.115 {configuration option: "foreground" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -1135,7 +1135,7 @@ test button-1.116 {configuration option: "foreground" for checkbutton} -setup { .c configure -foreground non-existent } -cleanup { destroy .c -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.117 {configuration option: "foreground" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1154,7 +1154,7 @@ test button-1.118 {configuration option: "foreground" for radiobutton} -setup { .r configure -foreground non-existent } -cleanup { destroy .r -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.119 {configuration option: "height" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1174,7 +1174,7 @@ test button-1.120 {configuration option: "height" for label} -setup { .l configure -height 20.0 } -cleanup { destroy .l -} -returnCodes {error} -result {expected integer but got "20.0"} +} -returnCodes error -result {expected integer but got "20.0"} test button-1.121 {configuration option: "height" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -1193,7 +1193,7 @@ test button-1.122 {configuration option: "height" for button} -setup { .b configure -height 20.0 } -cleanup { destroy .b -} -returnCodes {error} -result {expected integer but got "20.0"} +} -returnCodes error -result {expected integer but got "20.0"} test button-1.123 {configuration option: "height" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -1212,7 +1212,7 @@ test button-1.124 {configuration option: "height" for checkbutton} -setup { .c configure -height 20.0 } -cleanup { destroy .c -} -returnCodes {error} -result {expected integer but got "20.0"} +} -returnCodes error -result {expected integer but got "20.0"} test button-1.125 {configuration option: "height" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1231,7 +1231,7 @@ test button-1.126 {configuration option: "height" for radiobutton} -setup { .r configure -height 20.0 } -cleanup { destroy .r -} -returnCodes {error} -result {expected integer but got "20.0"} +} -returnCodes error -result {expected integer but got "20.0"} test button-1.127 {configuration option: "highlightbackground" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1251,7 +1251,7 @@ test button-1.128 {configuration option: "highlightbackground" for label} -setup .l configure -highlightbackground non-existent } -cleanup { destroy .l -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.129 {configuration option: "highlightbackground" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -1270,7 +1270,7 @@ test button-1.130 {configuration option: "highlightbackground" for button} -setu .b configure -highlightbackground non-existent } -cleanup { destroy .b -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.131 {configuration option: "highlightbackground" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -1289,7 +1289,7 @@ test button-1.132 {configuration option: "highlightbackground" for checkbutton} .c configure -highlightbackground non-existent } -cleanup { destroy .c -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.133 {configuration option: "highlightbackground" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1308,7 +1308,7 @@ test button-1.134 {configuration option: "highlightbackground" for radiobutton} .r configure -highlightbackground non-existent } -cleanup { destroy .r -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.135 {configuration option: "highlightcolor" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1328,7 +1328,7 @@ test button-1.136 {configuration option: "highlightcolor" for label} -setup { .l configure -highlightcolor non-existent } -cleanup { destroy .l -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.137 {configuration option: "highlightcolor" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -1347,7 +1347,7 @@ test button-1.138 {configuration option: "highlightcolor" for button} -setup { .b configure -highlightcolor non-existent } -cleanup { destroy .b -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.139 {configuration option: "highlightcolor" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -1366,7 +1366,7 @@ test button-1.140 {configuration option: "highlightcolor" for checkbutton} -setu .c configure -highlightcolor non-existent } -cleanup { destroy .c -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.141 {configuration option: "highlightcolor" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1385,7 +1385,7 @@ test button-1.142 {configuration option: "highlightcolor" for radiobutton} -setu .r configure -highlightcolor non-existent } -cleanup { destroy .r -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.143 {configuration option: "highlightthickness" for label} -setup { label .l -borderwidth 2 -font {Helvetica -12 bold} @@ -1405,7 +1405,7 @@ test button-1.144 {configuration option: "highlightthickness" for label} -setup .l configure -highlightthickness badValue } -cleanup { destroy .l -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.145 {configuration option: "highlightthickness" for button} -setup { button .b -borderwidth 2 -font {Helvetica -12 bold} pack .b @@ -1424,7 +1424,7 @@ test button-1.146 {configuration option: "highlightthickness" for button} -setup .b configure -highlightthickness badValue } -cleanup { destroy .b -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.147 {configuration option: "highlightthickness" for checkbutton} -setup { checkbutton .c -borderwidth 2 -font {Helvetica -12 bold} pack .c @@ -1443,7 +1443,7 @@ test button-1.148 {configuration option: "highlightthickness" for checkbutton} - .c configure -highlightthickness badValue } -cleanup { destroy .c -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.149 {configuration option: "highlightthickness" for radiobutton} -setup { radiobutton .r -borderwidth 2 -font {Helvetica -12 bold} pack .r @@ -1462,7 +1462,7 @@ test button-1.150 {configuration option: "highlightthickness" for radiobutton} - .r configure -highlightthickness badValue } -cleanup { destroy .r -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test button-1.151 {configuration option: "image" for label} -constraints { testImageType @@ -1486,7 +1486,7 @@ test button-1.152 {configuration option: "image" for label} -setup { .l configure -image bogus } -cleanup { destroy .l -} -returnCodes {error} -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test button-1.153 {configuration option: "image" for button} -constraints { testImageType } -setup { @@ -1509,7 +1509,7 @@ test button-1.154 {configuration option: "image" for button} -setup { .b configure -image bogus } -cleanup { destroy .b -} -returnCodes {error} -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test button-1.155 {configuration option: "image" for checkbutton} -constraints { testImageType } -setup { @@ -1532,7 +1532,7 @@ test button-1.156 {configuration option: "image" for checkbutton} -setup { .c configure -image bogus } -cleanup { destroy .c -} -returnCodes {error} -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test button-1.157 {configuration option: "image" for radiobutton} -constraints { testImageType } -setup { @@ -1555,7 +1555,7 @@ test button-1.158 {configuration option: "image" for radiobutton} -setup { .r configure -image bogus } -cleanup { destroy .r -} -returnCodes {error} -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test button-1.159 {configuration option: "indicatoron" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1575,7 +1575,7 @@ test button-1.160 {configuration option: "indicatoron" for checkbutton} -setup { .c configure -indicatoron no_way } -cleanup { destroy .c -} -returnCodes {error} -result {expected boolean value but got "no_way"} +} -returnCodes error -result {expected boolean value but got "no_way"} test button-1.161 {configuration option: "indicatoron" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1594,7 +1594,7 @@ test button-1.162 {configuration option: "indicatoron" for radiobutton} -setup { .r configure -indicatoron no_way } -cleanup { destroy .r -} -returnCodes {error} -result {expected boolean value but got "no_way"} +} -returnCodes error -result {expected boolean value but got "no_way"} test button-1.163 {configuration option: "justify" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1614,7 +1614,7 @@ test button-1.164 {configuration option: "justify" for label} -setup { .l configure -justify bogus } -cleanup { destroy .l -} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} +} -returnCodes error -result {bad justification "bogus": must be left, right, or center} test button-1.165 {configuration option: "justify" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -1633,7 +1633,7 @@ test button-1.166 {configuration option: "justify" for button} -setup { .b configure -justify bogus } -cleanup { destroy .b -} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} +} -returnCodes error -result {bad justification "bogus": must be left, right, or center} test button-1.167 {configuration option: "justify" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -1652,7 +1652,7 @@ test button-1.168 {configuration option: "justify" for checkbutton} -setup { .c configure -justify bogus } -cleanup { destroy .c -} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} +} -returnCodes error -result {bad justification "bogus": must be left, right, or center} test button-1.169 {configuration option: "justify" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1671,7 +1671,7 @@ test button-1.170 {configuration option: "justify" for radiobutton} -setup { .r configure -justify bogus } -cleanup { destroy .r -} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} +} -returnCodes error -result {bad justification "bogus": must be left, right, or center} test button-1.171 {configuration option: "offrelief" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1691,7 +1691,7 @@ test button-1.172 {configuration option: "offrelief" for checkbutton} -setup { .c configure -offrelief 1.5 } -cleanup { destroy .c -} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} test button-1.173 {configuration option: "offrelief" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1710,7 +1710,7 @@ test button-1.174 {configuration option: "offrelief" for radiobutton} -setup { .r configure -offrelief 1.5 } -cleanup { destroy .r -} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} test button-1.175 {configuration option: "offvalue" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1752,7 +1752,7 @@ test button-1.178 {configuration option: "overrelief" for button} -setup { .b configure -overrelief 1.5 } -cleanup { destroy .b -} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""} +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""} test button-1.179 {configuration option: "overrelief" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -1771,7 +1771,7 @@ test button-1.180 {configuration option: "overrelief" for checkbutton} -setup { .c configure -overrelief 1.5 } -cleanup { destroy .c -} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""} +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""} test button-1.181 {configuration option: "overrelief" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1790,7 +1790,7 @@ test button-1.182 {configuration option: "overrelief" for radiobutton} -setup { .r configure -overrelief 1.5 } -cleanup { destroy .r -} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""} +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""} test button-1.183 {configuration option: "padx" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1810,7 +1810,7 @@ test button-1.184 {configuration option: "padx" for label} -setup { .l configure -padx 420x } -cleanup { destroy .l -} -returnCodes {error} -result {expected screen distance but got "420x"} +} -returnCodes error -result {expected screen distance but got "420x"} test button-1.185 {configuration option: "padx" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -1829,7 +1829,7 @@ test button-1.186 {configuration option: "padx" for button} -setup { .b configure -padx 420x } -cleanup { destroy .b -} -returnCodes {error} -result {expected screen distance but got "420x"} +} -returnCodes error -result {expected screen distance but got "420x"} test button-1.187 {configuration option: "padx" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -1848,7 +1848,7 @@ test button-1.188 {configuration option: "padx" for checkbutton} -setup { .c configure -padx 420x } -cleanup { destroy .c -} -returnCodes {error} -result {expected screen distance but got "420x"} +} -returnCodes error -result {expected screen distance but got "420x"} test button-1.189 {configuration option: "padx" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1867,7 +1867,7 @@ test button-1.190 {configuration option: "padx" for radiobutton} -setup { .r configure -padx 420x } -cleanup { destroy .r -} -returnCodes {error} -result {expected screen distance but got "420x"} +} -returnCodes error -result {expected screen distance but got "420x"} test button-1.191 {configuration option: "pady" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1887,7 +1887,7 @@ test button-1.192 {configuration option: "pady" for label} -setup { .l configure -pady 420x } -cleanup { destroy .l -} -returnCodes {error} -result {expected screen distance but got "420x"} +} -returnCodes error -result {expected screen distance but got "420x"} test button-1.193 {configuration option: "pady" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -1906,7 +1906,7 @@ test button-1.194 {configuration option: "pady" for button} -setup { .b configure -pady 420x } -cleanup { destroy .b -} -returnCodes {error} -result {expected screen distance but got "420x"} +} -returnCodes error -result {expected screen distance but got "420x"} test button-1.195 {configuration option: "pady" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -1925,7 +1925,7 @@ test button-1.196 {configuration option: "pady" for checkbutton} -setup { .c configure -pady 420x } -cleanup { destroy .c -} -returnCodes {error} -result {expected screen distance but got "420x"} +} -returnCodes error -result {expected screen distance but got "420x"} test button-1.197 {configuration option: "pady" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1944,7 +1944,7 @@ test button-1.198 {configuration option: "pady" for radiobutton} -setup { .r configure -pady 420x } -cleanup { destroy .r -} -returnCodes {error} -result {expected screen distance but got "420x"} +} -returnCodes error -result {expected screen distance but got "420x"} test button-1.199 {configuration option: "repeatdelay" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1964,7 +1964,7 @@ test button-1.200 {configuration option: "repeatdelay" for button} -setup { .b configure -repeatdelay foo } -cleanup { destroy .b -} -returnCodes {error} -result {expected integer but got "foo"} +} -returnCodes error -result {expected integer but got "foo"} test button-1.201 {configuration option: "repeatinterval" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1984,7 +1984,7 @@ test button-1.202 {configuration option: "repeatinterval" for button} -setup { .b configure -repeatinterval foo } -cleanup { destroy .b -} -returnCodes {error} -result {expected integer but got "foo"} +} -returnCodes error -result {expected integer but got "foo"} test button-1.203 {configuration option: "relief" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -2004,7 +2004,7 @@ test button-1.204 {configuration option: "relief" for label} -setup { .l configure -relief 1.5 } -cleanup { destroy .l -} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} test button-1.205 {configuration option: "relief" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -2023,7 +2023,7 @@ test button-1.206 {configuration option: "relief" for button} -setup { .b configure -relief 1.5 } -cleanup { destroy .b -} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} test button-1.207 {configuration option: "relief" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -2042,7 +2042,7 @@ test button-1.208 {configuration option: "relief" for checkbutton} -setup { .c configure -relief 1.5 } -cleanup { destroy .c -} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} test button-1.209 {configuration option: "relief" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -2061,7 +2061,7 @@ test button-1.210 {configuration option: "relief" for radiobutton} -setup { .r configure -relief 1.5 } -cleanup { destroy .r -} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} test button-1.211 {configuration option: "selectcolor" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -2081,7 +2081,7 @@ test button-1.212 {configuration option: "selectcolor" for checkbutton} -setup { .c configure -selectcolor non-existent } -cleanup { destroy .c -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.213 {configuration option: "selectcolor" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -2100,7 +2100,7 @@ test button-1.214 {configuration option: "selectcolor" for radiobutton} -setup { .r configure -selectcolor non-existent } -cleanup { destroy .r -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test button-1.215 {configuration option: "selectimage" for checkbutton} -constraints { testImageType @@ -2124,7 +2124,7 @@ test button-1.216 {configuration option: "selectimage" for checkbutton} -setup { .c configure -selectimage bogus } -cleanup { destroy .c -} -returnCodes {error} -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test button-1.217 {configuration option: "selectimage" for radiobutton} -constraints { testImageType } -setup { @@ -2147,7 +2147,7 @@ test button-1.218 {configuration option: "selectimage" for radiobutton} -setup { .r configure -selectimage bogus } -cleanup { destroy .r -} -returnCodes {error} -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test button-1.219 {configuration option: "state" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -2167,7 +2167,7 @@ test button-1.220 {configuration option: "state" for label} -setup { .l configure -state bogus } -cleanup { destroy .l -} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal} +} -returnCodes error -result {bad state "bogus": must be active, disabled, or normal} test button-1.221 {configuration option: "state" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -2186,7 +2186,7 @@ test button-1.222 {configuration option: "state" for button} -setup { .b configure -state bogus } -cleanup { destroy .b -} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal} +} -returnCodes error -result {bad state "bogus": must be active, disabled, or normal} test button-1.223 {configuration option: "state" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -2205,7 +2205,7 @@ test button-1.224 {configuration option: "state" for checkbutton} -setup { .c configure -state bogus } -cleanup { destroy .c -} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal} +} -returnCodes error -result {bad state "bogus": must be active, disabled, or normal} test button-1.225 {configuration option: "state" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -2224,7 +2224,7 @@ test button-1.226 {configuration option: "state" for radiobutton} -setup { .r configure -state bogus } -cleanup { destroy .r -} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal} +} -returnCodes error -result {bad state "bogus": must be active, disabled, or normal} test button-1.227 {configuration option: "takefocus" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -2371,7 +2371,7 @@ test button-1.240 {configuration option: "tristateimage" for checkbutton} -setup .c configure -tristateimage bogus } -cleanup { destroy .c -} -returnCodes {error} -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test button-1.241 {configuration option: "tristateimage" for radiobutton} -constraints { testImageType } -setup { @@ -2394,7 +2394,7 @@ test button-1.242 {configuration option: "tristateimage" for radiobutton} -setup .r configure -tristateimage bogus } -cleanup { destroy .r -} -returnCodes {error} -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test button-1.243 {configuration option: "underline" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -2414,7 +2414,7 @@ test button-1.244 {configuration option: "underline" for label} -setup { .l configure -underline 3p } -cleanup { destroy .l -} -returnCodes {error} -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} +} -returnCodes error -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} test button-1.245 {configuration option: "underline" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -2433,7 +2433,7 @@ test button-1.246 {configuration option: "underline" for button} -setup { .b configure -underline 3p } -cleanup { destroy .b -} -returnCodes {error} -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} +} -returnCodes error -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} test button-1.247 {configuration option: "underline" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -2452,7 +2452,7 @@ test button-1.248 {configuration option: "underline" for checkbutton} -setup { .c configure -underline 3p } -cleanup { destroy .c -} -returnCodes {error} -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} +} -returnCodes error -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} test button-1.249 {configuration option: "underline" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -2471,7 +2471,7 @@ test button-1.250 {configuration option: "underline" for radiobutton} -setup { .r configure -underline 3p } -cleanup { destroy .r -} -returnCodes {error} -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} +} -returnCodes error -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} test button-1.251 {configuration option: "tristatevalue" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -2523,7 +2523,7 @@ test button-1.255 {configuration option: "width" for label} -setup { .l configure -width 3p } -cleanup { destroy .l -} -returnCodes {error} -result {expected integer but got "3p"} +} -returnCodes error -result {expected integer but got "3p"} test button-1.256 {configuration option: "width" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -2542,7 +2542,7 @@ test button-1.257 {configuration option: "width" for button} -setup { .b configure -width 3p } -cleanup { destroy .b -} -returnCodes {error} -result {expected integer but got "3p"} +} -returnCodes error -result {expected integer but got "3p"} test button-1.258 {configuration option: "width" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -2561,7 +2561,7 @@ test button-1.259 {configuration option: "width" for checkbutton} -setup { .c configure -width 3p } -cleanup { destroy .c -} -returnCodes {error} -result {expected integer but got "3p"} +} -returnCodes error -result {expected integer but got "3p"} test button-1.260 {configuration option: "width" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -2580,7 +2580,7 @@ test button-1.261 {configuration option: "width" for radiobutton} -setup { .r configure -width 3p } -cleanup { destroy .r -} -returnCodes {error} -result {expected integer but got "3p"} +} -returnCodes error -result {expected integer but got "3p"} test button-1.262 {configuration option: "wraplength" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -2600,7 +2600,7 @@ test button-1.263 {configuration option: "wraplength" for label} -setup { .l configure -wraplength 6x } -cleanup { destroy .l -} -returnCodes {error} -result {expected screen distance but got "6x"} +} -returnCodes error -result {expected screen distance but got "6x"} test button-1.264 {configuration option: "wraplength" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -2619,7 +2619,7 @@ test button-1.265 {configuration option: "wraplength" for button} -setup { .b configure -wraplength 6x } -cleanup { destroy .b -} -returnCodes {error} -result {expected screen distance but got "6x"} +} -returnCodes error -result {expected screen distance but got "6x"} test button-1.266 {configuration option: "wraplength" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -2638,7 +2638,7 @@ test button-1.267 {configuration option: "wraplength" for checkbutton} -setup { .c configure -wraplength 6x } -cleanup { destroy .c -} -returnCodes {error} -result {expected screen distance but got "6x"} +} -returnCodes error -result {expected screen distance but got "6x"} test button-1.268 {configuration option: "wraplength" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -2657,7 +2657,7 @@ test button-1.269 {configuration option: "wraplength" for radiobutton} -setup { .r configure -wraplength 6x } -cleanup { destroy .r -} -returnCodes {error} -result {expected screen distance but got "6x"} +} -returnCodes error -result {expected screen distance but got "6x"} test button-1.270 {configuration options} -body { # Additional check to make sure that -selectcolor may be empty in @@ -2682,7 +2682,7 @@ test button-1.271 {configuration options: fallback to default} -setup { # ex-tests 3.* test button-2.1 {ButtonCreate - not enough arguments} -body { button -} -returnCodes {error} -result {wrong # args: should be "button pathName ?-option value ...?"} +} -returnCodes error -result {wrong # args: should be "button pathName ?-option value ...?"} test button-2.2 {ButtonCreate procedure - setting label class} -body { label .x @@ -2721,7 +2721,7 @@ test button-2.7 {ButtonCreate - bad window name} -body { button foo } -cleanup { destroy foo -} -returnCodes {error} -result {bad window path name "foo"} +} -returnCodes error -result {bad window path name "foo"} ######### test ex 3.8 test button-2.8 {ButtonCreate procedure - error in default option value} -body { option add *funny.background bogus @@ -2729,7 +2729,7 @@ test button-2.8 {ButtonCreate procedure - error in default option value} -body { } -cleanup { option clear destroy .funny -} -returnCodes {error} -result {unknown color name "bogus"} +} -returnCodes error -result {unknown color name "bogus"} test button-2.9 {ButtonCreate procedure - error in default option value} -body { option add *funny.background bogus catch {button .funny} @@ -2746,7 +2746,7 @@ test button-2.10 {ButtonCreate procedure - option error} -body { button .x -gorp foo } -cleanup { destroy .x -} -returnCodes {error} -result {unknown option "-gorp"} +} -returnCodes error -result {unknown option "-gorp"} test button-2.11 {ButtonCreate procedure - option error} -body { catch {button .x -gorp foo} winfo exists .x @@ -2767,31 +2767,31 @@ test button-3.1 {ButtonWidgetCmd - too few arguments} -body { .b } -cleanup { destroy .b -} -returnCodes {error} -result {wrong # args: should be ".b option ?arg ...?"} +} -returnCodes error -result {wrong # args: should be ".b option ?arg ...?"} test button-3.2 {ButtonWidgetCmd - bad option name} -body { button .b .b c } -cleanup { destroy .b -} -returnCodes {error} -result {ambiguous option "c": must be cget, configure, flash, or invoke} +} -returnCodes error -result {ambiguous option "c": must be cget, configure, flash, or invoke} test button-3.3 {ButtonWidgetCmd - bad option name} -body { button .b .b bogus } -cleanup { destroy .b -} -returnCodes {error} -result {bad option "bogus": must be cget, configure, flash, or invoke} +} -returnCodes error -result {bad option "bogus": must be cget, configure, flash, or invoke} test button-3.4 {ButtonWidgetCmd procedure, "cget" option} -body { button .b .b cget a b } -cleanup { destroy .b -} -returnCodes {error} -result {wrong # args: should be ".b cget option"} +} -returnCodes error -result {wrong # args: should be ".b cget option"} test button-3.5 {ButtonWidgetCmd procedure, "cget" option} -body { button .b .b cget -gorp } -cleanup { destroy .b -} -returnCodes {error} -result {unknown option "-gorp"} +} -returnCodes error -result {unknown option "-gorp"} #ex 4.7 test button-3.6 {ButtonWidgetCmd procedure, "cget" option} -body { @@ -2799,45 +2799,45 @@ test button-3.6 {ButtonWidgetCmd procedure, "cget" option} -body { .l cget -disabledforeground } -cleanup { destroy .l -} -returnCodes {ok} -match {glob} -result {*} +} -returnCodes {ok} -match glob -result {*} test button-3.7 {ButtonWidgetCmd procedure, "cget" option} -body { button .b .b cget -disabledforeground } -cleanup { destroy .b -} -returnCodes {ok} -match {glob} -result {*} +} -returnCodes {ok} -match glob -result {*} test button-3.8 {ButtonWidgetCmd procedure, "cget" option} -body { button .b .b cget -variable } -cleanup { destroy .b -} -returnCodes {error} -result {unknown option "-variable"} +} -returnCodes error -result {unknown option "-variable"} test button-3.9 {ButtonWidgetCmd procedure, "cget" option} -body { checkbutton .c .c cget -variable } -cleanup { destroy .c -} -returnCodes {ok} -match {glob} -result {*} +} -returnCodes {ok} -match glob -result {*} test button-3.10 {ButtonWidgetCmd procedure, "cget" option} -body { checkbutton .c .c cget -value } -cleanup { destroy .c -} -returnCodes {error} -result {unknown option "-value"} +} -returnCodes error -result {unknown option "-value"} test button-3.11 {ButtonWidgetCmd procedure, "cget" option} -body { radiobutton .r .r cget -value } -cleanup { destroy .r -} -returnCodes {ok} -match {glob} -result {*} +} -returnCodes {ok} -match glob -result {*} test button-3.12 {ButtonWidgetCmd procedure, "cget" option} -body { radiobutton .r .r cget -onvalue } -cleanup { destroy .r -} -returnCodes {error} -result {unknown option "-onvalue"} +} -returnCodes error -result {unknown option "-onvalue"} # ex 4.6 test button-3.13 {ButtonWidgetCmd procedure, "configure" option} -body { @@ -2857,14 +2857,14 @@ test button-3.15 {ButtonWidgetCmd procedure, "configure" option} -body { .b configure -gorp } -cleanup { destroy .b -} -returnCodes {error} -result {unknown option "-gorp"} +} -returnCodes error -result {unknown option "-gorp"} test button-3.16 {ButtonWidgetCmd procedure, "configure" option} -setup { button .b } -body { .b co -bg #ffffff -fg } -cleanup { destroy .b -} -returnCodes {error} -result {value for "-fg" missing} +} -returnCodes error -result {value for "-fg" missing} test button-3.17 {ButtonWidgetCmd procedure, "configure" option} -setup { button .b } -body { @@ -2879,19 +2879,19 @@ test button-3.18 {ButtonWidgetCmd procedure, "deselect" option} -body { .c deselect foo } -cleanup { destroy .c -} -returnCodes {error} -result {wrong # args: should be ".c deselect"} +} -returnCodes error -result {wrong # args: should be ".c deselect"} test button-3.19 {ButtonWidgetCmd procedure, "deselect" option} -body { label .l .l deselect } -cleanup { destroy .l -} -returnCodes {error} -result {bad option "deselect": must be cget or configure} +} -returnCodes error -result {bad option "deselect": must be cget or configure} test button-3.20 {ButtonWidgetCmd procedure, "deselect" option} -body { button .b .b deselect } -cleanup { destroy .b -} -returnCodes {error} -result {bad option "deselect": must be cget, configure, flash, or invoke} +} -returnCodes error -result {bad option "deselect": must be cget, configure, flash, or invoke} test button-3.21 {ButtonWidgetCmd procedure, "deselect" option} -body { checkbutton .c -variable checkvar -onvalue 1 -offvalue 0 @@ -2926,7 +2926,7 @@ test button-3.24 {ButtonWidgetCmd procedure, "deselect" option} -body { } -cleanup { destroy .c trace remove variable checkvar write bogusTrace -} -returnCodes {error} -result {can't set "checkvar": trace aborted} +} -returnCodes error -result {can't set "checkvar": trace aborted} test button-3.25 {ButtonWidgetCmd procedure, "deselect" option} -body { checkbutton .c -variable checkvar -onvalue 1 -offvalue 0 set checkvar 1 @@ -2936,7 +2936,7 @@ test button-3.25 {ButtonWidgetCmd procedure, "deselect" option} -body { } -cleanup { trace remove variable checkvar write bogusTrace destroy .c -} -match {glob} -result {{*trace aborted +} -match glob -result {{*trace aborted while executing * ".c deselect"} 0} @@ -2948,7 +2948,7 @@ test button-3.26 {ButtonWidgetCmd procedure, "deselect" option} -body { } -cleanup { destroy .r trace remove variable radiovar write bogusTrace -} -match {glob} -returnCodes {error} -result {can't set "radiovar": trace aborted} +} -match glob -returnCodes error -result {can't set "radiovar": trace aborted} test button-3.27 {ButtonWidgetCmd procedure, "deselect" option} -body { radiobutton .r -variable radiovar -value red set radiovar red @@ -2968,44 +2968,44 @@ test button-3.28 {ButtonWidgetCmd procedure, "flash" option} -body { .b flash foo } -cleanup { destroy .b -} -returnCodes {error} -result {wrong # args: should be ".b flash"} +} -returnCodes error -result {wrong # args: should be ".b flash"} test button-3.29 {ButtonWidgetCmd procedure, "flash" option} -body { label .l .l flash } -cleanup { destroy .l -} -returnCodes {error} -result {bad option "flash": must be cget or configure} +} -returnCodes error -result {bad option "flash": must be cget or configure} test button-3.30 {ButtonWidgetCmd procedure, "flash" option} -body { button .b catch {.b flash} } -cleanup { destroy .b -} -returnCodes {ok} -match {glob} -result {*} +} -returnCodes {ok} -match glob -result {*} test button-3.31 {ButtonWidgetCmd procedure, "flash" option} -body { checkbutton .c catch {.c flash} } -cleanup { destroy .c -} -returnCodes {ok} -match {glob} -result {*} +} -returnCodes {ok} -match glob -result {*} test button-3.32 {ButtonWidgetCmd procedure, "flash" option} -body { radiobutton .r catch {.r f} } -cleanup { destroy .r -} -returnCodes {ok} -match {glob} -result {*} +} -returnCodes {ok} -match glob -result {*} test button-3.33 {ButtonWidgetCmd procedure, "invoke" option} -body { label .l .l invoke } -cleanup { destroy .l -} -returnCodes {error} -result {bad option "invoke": must be cget or configure} +} -returnCodes error -result {bad option "invoke": must be cget or configure} test button-3.34 {ButtonWidgetCmd procedure, "invoke" option} -body { button .b .b invoke foo } -cleanup { destroy .b -} -returnCodes {error} -result {wrong # args: should be ".b invoke"} +} -returnCodes error -result {wrong # args: should be ".b invoke"} test button-3.35 {ButtonWidgetCmd procedure, "invoke" option} -body { button .b .b configure -command {set x invoked} @@ -3026,7 +3026,7 @@ test button-3.36 {ButtonWidgetCmd procedure, "invoke" option} -body { } -result {not invoked} test button-3.37 {ButtonWidgetCmd procedure, "invoke" option} -body { checkbutton .c -variable checkvar -onvalue 1 -offvalue 0 \ - -command {set x invoked} + -command {set x invoked} set checkvar bogus set x "not invoked" .c invoke @@ -3049,19 +3049,19 @@ test button-3.39 {ButtonWidgetCmd procedure, "select" option} -body { .l select } -cleanup { destroy .l -} -returnCodes {error} -result {bad option "select": must be cget or configure} +} -returnCodes error -result {bad option "select": must be cget or configure} test button-3.40 {ButtonWidgetCmd procedure, "select" option} -body { button .b .b select } -cleanup { destroy .b -} -returnCodes {error} -result {bad option "select": must be cget, configure, flash, or invoke} +} -returnCodes error -result {bad option "select": must be cget, configure, flash, or invoke} test button-3.41 {ButtonWidgetCmd procedure, "select" option} -body { checkbutton .c .c select foo } -cleanup { destroy .c -} -returnCodes {error} -result {wrong # args: should be ".c select"} +} -returnCodes error -result {wrong # args: should be ".c select"} test button-3.42 {ButtonWidgetCmd procedure, "select" option} -body { checkbutton .c -variable checkvar -onvalue lovely -offvalue 0 set checkvar bogus @@ -3086,7 +3086,7 @@ test button-3.44 {ButtonWidgetCmd procedure, "select" option} -body { } -cleanup { destroy .r trace remove variable radiovar write bogusTrace -} -returnCodes {error} -result {can't set "radiovar": trace aborted} +} -returnCodes error -result {can't set "radiovar": trace aborted} test button-3.45 {ButtonWidgetCmd procedure, "select" option} -body { radiobutton .r -variable radiovar -value red set radiovar yellow @@ -3096,7 +3096,7 @@ test button-3.45 {ButtonWidgetCmd procedure, "select" option} -body { } -cleanup { destroy .r trace remove variable radiovar write bogusTrace -} -match {glob} -result {{*trace aborted +} -match glob -result {{*trace aborted while executing * ".r select"} red} @@ -3107,25 +3107,25 @@ test button-3.46 {ButtonWidgetCmd procedure, "toggle" option} -body { .l toggle } -cleanup { destroy .l -} -returnCodes {error} -result {bad option "toggle": must be cget or configure} +} -returnCodes error -result {bad option "toggle": must be cget or configure} test button-3.47 {ButtonWidgetCmd procedure, "toggle" option} -body { button .b .b toggle } -cleanup { destroy .b -} -returnCodes {error} -result {bad option "toggle": must be cget, configure, flash, or invoke} +} -returnCodes error -result {bad option "toggle": must be cget, configure, flash, or invoke} test button-3.48 {ButtonWidgetCmd procedure, "toggle" option} -body { radiobutton .r .r toggle } -cleanup { destroy .r -} -returnCodes {error} -result {bad option "toggle": must be cget, configure, deselect, flash, invoke, or select} +} -returnCodes error -result {bad option "toggle": must be cget, configure, deselect, flash, invoke, or select} test button-3.49 {ButtonWidgetCmd procedure, "toggle" option} -body { checkbutton .c .c toggle foo } -cleanup { destroy .c -} -returnCodes {error} -result {wrong # args: should be ".c toggle"} +} -returnCodes error -result {wrong # args: should be ".c toggle"} test button-3.50 {ButtonWidgetCmd procedure, "toggle" option} -body { set checkvar bogus checkbutton .c -variable checkvar -onvalue sunshine -offvalue rain @@ -3147,7 +3147,7 @@ test button-3.51 {ButtonWidgetCmd procedure, "toggle" option} -body { } -cleanup { destroy .c trace remove variable checkvar write bogusTrace -} -returnCodes {error} -result {can't set "checkvar": trace aborted} +} -returnCodes error -result {can't set "checkvar": trace aborted} test button-3.52 {ButtonWidgetCmd procedure, "toggle" option} -body { checkbutton .c -variable checkvar -onvalue xyz -offvalue abc set checkvar xyz @@ -3157,7 +3157,7 @@ test button-3.52 {ButtonWidgetCmd procedure, "toggle" option} -body { } -cleanup { trace remove variable checkvar write bogusTrace destroy .c -} -match {glob} -result {{*trace aborted +} -match glob -result {{*trace aborted while executing * ".c toggle"} abc} @@ -3169,7 +3169,7 @@ test button-3.53 {ButtonWidgetCmd procedure, "toggle" option} -body { } -cleanup { trace remove variable checkvar write bogusTrace destroy .c -} -returnCodes {error} -result {can't set "checkvar": trace aborted} +} -returnCodes error -result {can't set "checkvar": trace aborted} test button-3.54 {ButtonWidgetCmd procedure, "toggle" option} -body { checkbutton .c -variable checkvar -onvalue xyz -offvalue abc set checkvar abc @@ -3179,7 +3179,7 @@ test button-3.54 {ButtonWidgetCmd procedure, "toggle" option} -body { } -cleanup { trace remove variable checkvar write bogusTrace destroy .c -} -match {glob} -result {{*trace aborted +} -match glob -result {{*trace aborted while executing * ".c toggle"} xyz} @@ -3192,7 +3192,7 @@ test button-3.55 {ButtonWidgetCmd procedure, "toggle" option} -setup { .c toggle } -cleanup { destroy .c -} -returnCodes {error} -result {can't set "checkvar": variable is array} +} -returnCodes error -result {can't set "checkvar": variable is array} test button-3.56 {ButtonWidgetCmd procedure, "toggle" option} -setup { unset -nocomplain checkvar } -body { @@ -3203,7 +3203,7 @@ test button-3.56 {ButtonWidgetCmd procedure, "toggle" option} -setup { return $errorInfo } -cleanup { destroy .c -} -match {glob} -result {can't set "checkvar": variable is array +} -match glob -result {can't set "checkvar": variable is array while executing ".c toggle"} @@ -3232,7 +3232,7 @@ test button-5.1 {ConfigureButton - textvariable trace} -body { .b configure -bd 7 -bg red -fg bogus } -cleanup { destroy .b -} -returnCodes {error} -result {unknown color name "bogus"} +} -returnCodes error -result {unknown color name "bogus"} test button-5.2 {ConfigureButton - textvariable trace} -body { button .b -bd 4 -bg green catch {.b configure -bd 7 -bg red -fg bogus} @@ -3320,13 +3320,13 @@ test button-5.10 {ConfigureButton - error in setting variable} -setup { } -cleanup { destroy .r trace remove variable x write bogusTrace -} -returnCodes {error} -result {can't set "x": trace aborted} +} -returnCodes error -result {can't set "x": trace aborted} test button-5.11 {ConfigureButton - bad image name} -body { button .b -image bogus } -cleanup { destroy .b -} -returnCodes {error} -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test button-5.12 {ConfigureButton - setting variable from current text value} -setup { unset -nocomplain x @@ -3353,7 +3353,7 @@ test button-5.14 {ConfigureButton - variable handling} -setup { } -cleanup { trace remove variable x write bogusTrace destroy .r -} -returnCodes {error} -result {can't set "x": trace aborted} +} -returnCodes error -result {can't set "x": trace aborted} test button-5.15 {ConfigureButton - variable handling} -setup { unset -nocomplain x } -body { @@ -3371,7 +3371,7 @@ test button-5.16 {ConfigureButton - -width option} -body { .b configure -width 1i } -cleanup { destroy .b -} -returnCodes {error} -result {expected integer but got "1i"} +} -returnCodes error -result {expected integer but got "1i"} test button-5.17 {ConfigureButton - -width option} -body { button .b -text "Button 1" catch {.b configure -width 1i} @@ -3387,7 +3387,7 @@ test button-5.18 {ConfigureButton - -height option} -body { .b configure -height 0.5c } -cleanup { destroy .b -} -returnCodes {error} -result {expected integer but got "0.5c"} +} -returnCodes error -result {expected integer but got "0.5c"} test button-5.19 {ConfigureButton - -height option} -body { button .b -text "Button 1" catch {.b configure -height 0.5c} @@ -3404,7 +3404,7 @@ test button-5.20 {ConfigureButton - -width option} -body { .b configure -width abc } -cleanup { destroy .b -} -returnCodes {error} -result {expected screen distance but got "abc"} +} -returnCodes error -result {expected screen distance but got "abc"} test button-5.21 {ConfigureButton - -width option} -body { button .b -bitmap questhead catch {.b configure -width abc} @@ -3425,7 +3425,7 @@ test button-5.22 {ConfigureButton - -height option} -constraints { } -cleanup { destroy .b image delete image1 -} -returnCodes {error} -result {expected screen distance but got "0.5x"} +} -returnCodes error -result {expected screen distance but got "0.5x"} test button-5.23 {ConfigureButton - -height option} -constraints { testImageType } -setup { @@ -3447,41 +3447,41 @@ test button-5.24 {ConfigureButton - computing geometry} -constraints { fonts } -body { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -padx 30 -pady 20 + -padx 30 -pady 20 # 1. button with text .b configure -text "Sample text" pack .b set textwidth [font measure [.b cget -font] -displayof .b [.b cget -text]] set expectedwidth [expr {$textwidth + 2*[.b cget -borderwidth] \ - + 2*[.b cget -highlightthickness] + 2*[.b cget -padx]}] + + 2*[.b cget -highlightthickness] + 2*[.b cget -padx]}] incr expectedwidth 2 ; # added (hardcoded) in tkUnixButton.c set result [expr {$expectedwidth == [winfo reqwidth .b]}] set linespace [lindex [font metrics [.b cget -font] -displayof .b] 5] set expectedheight [expr {$linespace + 2*[.b cget -borderwidth] \ - + 2*[.b cget -highlightthickness] + 2*[.b cget -pady]}] + + 2*[.b cget -highlightthickness] + 2*[.b cget -pady]}] incr expectedheight 2 ; # added (hardcoded) in tkUnixButton.c lappend result [expr {$expectedheight == [winfo reqheight .b]}] # 2. button with a bitmap image # there is no access to characteristics the predefined bitmaps, # so define one as an image (copied from questhead.xbm) set myquesthead [image create bitmap -data { - #define myquesthead_width 20 - #define myquesthead_height 22 - static unsigned char myquesthead_bits[] = { - 0xf8, 0x1f, 0x00, 0xac, 0x2a, 0x00, 0x56, 0x55, 0x00, 0xeb, 0xaf, 0x00, - 0xf5, 0x5f, 0x01, 0xfb, 0xbf, 0x00, 0x75, 0x5d, 0x01, 0xfb, 0xbe, 0x02, - 0x75, 0x5d, 0x05, 0xab, 0xbe, 0x0a, 0x55, 0x5f, 0x07, 0xab, 0xaf, 0x00, - 0xd6, 0x57, 0x01, 0xac, 0xab, 0x00, 0xd8, 0x57, 0x00, 0xb0, 0xaa, 0x00, - 0x50, 0x55, 0x00, 0xb0, 0x0b, 0x00, 0xd0, 0x17, 0x00, 0xb0, 0x0b, 0x00, - 0x58, 0x15, 0x00, 0xa8, 0x2a, 0x00}; + #define myquesthead_width 20 + #define myquesthead_height 22 + static unsigned char myquesthead_bits[] = { + 0xf8, 0x1f, 0x00, 0xac, 0x2a, 0x00, 0x56, 0x55, 0x00, 0xeb, 0xaf, 0x00, + 0xf5, 0x5f, 0x01, 0xfb, 0xbf, 0x00, 0x75, 0x5d, 0x01, 0xfb, 0xbe, 0x02, + 0x75, 0x5d, 0x05, 0xab, 0xbe, 0x0a, 0x55, 0x5f, 0x07, 0xab, 0xaf, 0x00, + 0xd6, 0x57, 0x01, 0xac, 0xab, 0x00, 0xd8, 0x57, 0x00, 0xb0, 0xaa, 0x00, + 0x50, 0x55, 0x00, 0xb0, 0x0b, 0x00, 0xd0, 0x17, 0x00, 0xb0, 0x0b, 0x00, + 0x58, 0x15, 0x00, 0xa8, 0x2a, 0x00}; }] .b configure -image $myquesthead set expectedwidth [expr {[image width $myquesthead] + 2*[.b cget -borderwidth] \ - + 2*[.b cget -highlightthickness]}] + + 2*[.b cget -highlightthickness]}] incr expectedwidth 2 ; # added (hardcoded) in tkUnixButton.c lappend result [expr {$expectedwidth == [winfo reqwidth .b]}] set expectedheight [expr {[image height $myquesthead] + 2*[.b cget -borderwidth] \ - + 2*[.b cget -highlightthickness]}] + + 2*[.b cget -highlightthickness]}] incr expectedheight 2 ; # added (hardcoded) in tkUnixButton.c lappend result [expr {$expectedheight == [winfo reqheight .b]}] } -cleanup { @@ -3554,7 +3554,7 @@ test button-8.2 {TkInvokeButton procedure} -setup { } -cleanup { destroy .c trace remove variable x write bogusTrace -} -returnCodes {error} -result {can't set "x": trace aborted} +} -returnCodes error -result {can't set "x": trace aborted} test button-8.3 {TkInvokeButton procedure} -setup { set x 0 } -body { @@ -3575,7 +3575,7 @@ test button-8.4 {TkInvokeButton procedure} -setup { } -cleanup { destroy .c trace remove variable x write bogusTrace -} -returnCodes {error} -result {can't set "x": trace aborted} +} -returnCodes error -result {can't set "x": trace aborted} test button-8.5 {TkInvokeButton procedure} -setup { set x 1 } -body { @@ -3609,7 +3609,7 @@ test button-8.7 {TkInvokeButton procedure} -body { } -cleanup { destroy .r trace remove variable x write bogusTrace -} -returnCodes {error} -result {can't set "x": trace aborted} +} -returnCodes error -result {can't set "x": trace aborted} test button-8.8 {TkInvokeButton procedure} -body { radiobutton .r -variable x -value red set x green @@ -3619,7 +3619,7 @@ test button-8.8 {TkInvokeButton procedure} -body { } -cleanup { destroy .r trace remove variable x write bogusTrace -} -match {glob} -result {{*trace aborted +} -match glob -result {{*trace aborted while executing * ".r invoke"} red} @@ -3953,9 +3953,9 @@ test button-13.8 {size behavior: checkbutton} -setup { test button-14.1 {bug fix: [011706ec42] tk::ButtonInvoke unsafe wrt widget destruction} -body { proc destroy_button {} { - if {[winfo exists .top.b]} { - destroy .top.b - } + if {[winfo exists .top.b]} { + destroy .top.b + } } toplevel .top button .top.b -text Foo -command destroy_button diff --git a/tests/canvImg.test b/tests/canvImg.test index bf532fe..2ac7435 100644 --- a/tests/canvImg.test +++ b/tests/canvImg.test @@ -29,7 +29,7 @@ test canvImg-1.2 {options for image items} -body { .c create image 50 50 -anchor gorp -tags i1 } -cleanup { .c delete all -} -returnCodes {error} -result {bad anchor position "gorp": must be n, ne, e, se, s, sw, w, nw, or center} +} -returnCodes error -result {bad anchor "gorp": must be n, ne, e, se, s, sw, w, nw, or center} test canvImg-1.3 {options for image items} -constraints testImageType -setup { image create test foo .c delete all @@ -44,7 +44,7 @@ test canvImg-1.4 {options for image items} -body { .c create image 50 50 -image unknown -tags i1 } -cleanup { .c delete all -} -returnCodes {error} -result {image "unknown" doesn't exist} +} -returnCodes error -result {image "unknown" does not exist} test canvImg-1.5 {options for image items} -constraints testImageType -setup { image create test foo .c delete all @@ -60,12 +60,12 @@ test canvImg-2.1 {CreateImage procedure} -body { .c create image 40 } -cleanup { .c delete all -} -returnCodes {error} -result {wrong # coordinates: expected 2, got 1} +} -returnCodes error -result {wrong # coordinates: expected 2, got 1} test canvImg-2.2 {CreateImage procedure} -body { .c create image 40 50 60 } -cleanup { .c delete all -} -returnCodes {error} -result {unknown option "60"} +} -returnCodes error -result {unknown option "60"} test canvImg-2.3 {CreateImage procedure} -body { .c delete all set i [.c create image 50 50] @@ -79,17 +79,17 @@ test canvImg-2.4 {CreateImage procedure} -body { .c create image xyz 40 } -cleanup { .c delete all -} -returnCodes {error} -result {expected screen distance but got "xyz"} +} -returnCodes error -result {expected screen distance but got "xyz"} test canvImg-2.5 {CreateImage procedure} -body { .c create image 50 qrs } -cleanup { .c delete all -} -returnCodes {error} -result {expected screen distance but got "qrs"} +} -returnCodes error -result {expected screen distance but got "qrs"} test canvImg-2.6 {CreateImage procedure} -constraints testImageType -body { .c create image 50 50 -gorp foo } -cleanup { .c delete all -} -returnCodes {error} -result {unknown option "-gorp"} +} -returnCodes error -result {unknown option "-gorp"} test canvImg-3.1 {ImageCoords procedure} -constraints testImageType -setup { @@ -109,7 +109,7 @@ test canvImg-3.2 {ImageCoords procedure} -constraints testImageType -setup { } -cleanup { .c delete all image delete foo -} -returnCodes {error} -result {expected screen distance but got "dumb"} +} -returnCodes error -result {expected screen distance but got "dumb"} test canvImg-3.3 {ImageCoords procedure} -constraints testImageType -setup { image create test foo } -body { @@ -119,7 +119,7 @@ test canvImg-3.3 {ImageCoords procedure} -constraints testImageType -setup { } -cleanup { .c delete all image delete foo -} -returnCodes {error} -result {expected screen distance but got "dumb0"} +} -returnCodes error -result {expected screen distance but got "dumb0"} test canvImg-3.4 {ImageCoords procedure} -constraints testImageType -setup { image create test foo } -body { @@ -129,7 +129,7 @@ test canvImg-3.4 {ImageCoords procedure} -constraints testImageType -setup { } -cleanup { .c delete all image delete foo -} -returnCodes {error} -result {wrong # coordinates: expected 2, got 1} +} -returnCodes error -result {wrong # coordinates: expected 2, got 1} test canvImg-3.5 {ImageCoords procedure} -constraints testImageType -setup { image create test foo } -body { @@ -139,7 +139,7 @@ test canvImg-3.5 {ImageCoords procedure} -constraints testImageType -setup { } -cleanup { .c delete all image delete foo -} -returnCodes {error} -result {wrong # coordinates: expected 0 or 2, got 3} +} -returnCodes error -result {wrong # coordinates: expected 0 or 2, got 3} test canvImg-4.1 {ConfiugreImage procedure} -constraints testImageType -setup { @@ -195,7 +195,7 @@ test canvImg-4.3 {ConfiugreImage procedure} -constraints testImageType -setup { } -cleanup { .c delete all image delete foo foo2 -} -returnCodes {error} -result {image "lousy" doesn't exist} +} -returnCodes error -result {image "lousy" does not exist} test canvImg-5.1 {DeleteImage procedure} -constraints testImageType -setup { diff --git a/tests/canvPsImg.tcl b/tests/canvPsImg.tcl index 1f46eca..273ca7d 100644 --- a/tests/canvPsImg.tcl +++ b/tests/canvPsImg.tcl @@ -53,9 +53,9 @@ foreach v [winfo visualsavailable .] { # The hack below is necessary for some systems, which have more than one # visual of the same type... if {![winfo exists .t.$v]} { - radiobutton .t.$v -text $v -variable visual -value $v \ + radiobutton .t.$v -text $v -variable visual -value $v \ -command BuildTestImage - pack .t.$v -in .t.top.l -anchor w + pack .t.$v -in .t.top.l -anchor w } } diff --git a/tests/canvText.test b/tests/canvText.test index d685c45..5b08df7 100644 --- a/tests/canvText.test +++ b/tests/canvText.test @@ -11,6 +11,8 @@ namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands +testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] + # Canvas used in 1.* - 17.* tests canvas .c -width 400 -height 300 -bd 2 -relief sunken pack .c @@ -24,7 +26,7 @@ test canvText-1.1 {configuration options: good value for "anchor"} -body { } -result {nw nw} test canvasText-1.2 {configuration options: bad value for "anchor"} -body { .c itemconfigure test -anchor xyz -} -returnCodes error -result {bad anchor position "xyz": must be n, ne, e, se, s, sw, w, nw, or center} +} -returnCodes error -result {bad anchor "xyz": must be n, ne, e, se, s, sw, w, nw, or center} test canvText-1.3 {configuration options: good value for "fill"} -body { .c itemconfigure test -fill #ff0000 list [lindex [.c itemconfigure test -fill] 4] [.c itemcget test -fill] @@ -42,7 +44,7 @@ test canvText-1.6 {configuration options: good value for "font"} -body { } -result {{Times 40} {Times 40}} test canvasText-1.7 {configuration options: bad value for "font"} -body { .c itemconfigure test -font {} -} -returnCodes error -result {font "" doesn't exist} +} -returnCodes error -result {font "" does not exist} test canvText-1.8 {configuration options: good value for "justify"} -body { .c itemconfigure test -justify left list [lindex [.c itemconfigure test -justify] 4] [.c itemcget test -justify] @@ -95,22 +97,22 @@ test canvasText-1.19 {configuration options: bounding of "angle"} -body { test canvText-2.1 {CreateText procedure: args} -body { .c create text -} -returnCodes {error} -result {wrong # args: should be ".c create text coords ?arg ...?"} +} -returnCodes error -result {wrong # args: should be ".c create text coords ?arg ...?"} test canvText-2.2 {CreateText procedure: args} -body { .c create text xyz 0 } -cleanup { .c delete all -} -returnCodes {error} -result {expected screen distance but got "xyz"} +} -returnCodes error -result {expected screen distance but got "xyz"} test canvText-2.3 {CreateText procedure: args} -body { .c create text 0 xyz } -cleanup { .c delete all -} -returnCodes {error} -result {expected screen distance but got "xyz"} +} -returnCodes error -result {expected screen distance but got "xyz"} test canvText-2.4 {CreateText procedure: args} -body { .c create text 0 0 -xyz xyz } -cleanup { .c delete all -} -returnCodes {error} -result {unknown option "-xyz"} +} -returnCodes error -result {unknown option "-xyz"} test canvText-2.5 {CreateText procedure} -body { .c create text 0 0 -tags x .c coords x @@ -133,14 +135,14 @@ test canvText-3.2 {TextCoords procedure} -setup { .c coords test xyz 0 } -cleanup { .c delete test -} -returnCodes {error} -result {expected screen distance but got "xyz"} +} -returnCodes error -result {expected screen distance but got "xyz"} test canvText-3.3 {TextCoords procedure} -setup { .c create text 20 20 -tag test } -body { .c coords test 0 xyz } -cleanup { .c delete test -} -returnCodes {error} -result {expected screen distance but got "xyz"} +} -returnCodes error -result {expected screen distance but got "xyz"} test canvText-3.4 {TextCoords procedure} -setup { .c create text 20 20 -tag test } -body { @@ -159,14 +161,14 @@ test canvText-3.5 {TextCoords procedure} -setup { .c coords test 10 } -cleanup { .c delete test -} -returnCodes {error} -result {wrong # coordinates: expected 2, got 1} +} -returnCodes error -result {wrong # coordinates: expected 2, got 1} test canvText-3.6 {TextCoords procedure} -setup { .c create text 20 20 -tag test } -body { .c coords test 10 10 10 } -cleanup { .c delete test -} -returnCodes {error} -result {wrong # coordinates: expected 0 or 2, got 3} +} -returnCodes error -result {wrong # coordinates: expected 0 or 2, got 3} test canvText-4.1 {ConfigureText procedure} -setup { @@ -175,7 +177,7 @@ test canvText-4.1 {ConfigureText procedure} -setup { .c itemconfig test -fill xyz } -cleanup { .c delete test -} -returnCodes {error} -result {unknown color name "xyz"} +} -returnCodes error -result {unknown color name "xyz"} test canvText-4.2 {ConfigureText procedure} -setup { .c create text 20 20 -tag test } -body { @@ -260,7 +262,7 @@ test canvText-5.1 {ConfigureText procedure: adjust cursor} -body { } -result {} -test canvText-6.1 {ComputeTextBbox procedure} -constraints fonts -setup { +test canvText-6.1 {ComputeTextBbox procedure} -constraints {fonts failsOnXQuarz} -setup { .c delete test } -body { set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*" @@ -312,7 +314,7 @@ test canvText-6.4 {ComputeTextBbox procedure} -constraints fonts -setup { } -cleanup { .c delete test } -result 1 -test canvText-6.5 {ComputeTextBbox procedure} -constraints fonts -setup { +test canvText-6.5 {ComputeTextBbox procedure} -constraints {fonts failsOnXQuarz} -setup { .c delete test } -body { set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*" @@ -364,7 +366,7 @@ test canvText-6.8 {ComputeTextBbox procedure} -constraints fonts -setup { } -cleanup { .c delete test } -result 1 -test canvText-6.9 {ComputeTextBbox procedure} -constraints fonts -setup { +test canvText-6.9 {ComputeTextBbox procedure} -constraints {fonts failsOnXQuarz} -setup { .c delete test } -body { set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*" @@ -636,7 +638,7 @@ test canvText-9.8 {TextInsert procedure: selectFirst > selectLast: deselect} -bo .c select to test 8 .c dchars test 3 10 .c index test sel.first -} -returnCodes {error} -result {selection isn't in item} +} -returnCodes error -result {selection isn't in item} test canvText-9.9 {TextInsert procedure: selectFirst <= selectLast} -body { .c itemconfig test -text "abcdefghijk" .c select from test 4 @@ -766,7 +768,7 @@ test canvText-14.2 {GetTextIndex procedure: select error} -setup { .c index test sel.first } -cleanup { .c delete test -} -returnCodes {error} -result {selection isn't in item} +} -returnCodes error -result {selection isn't in item} test canvText-14.3 {GetTextIndex procedure: select error} -setup { .c create text 0 0 -tag test focus .c @@ -776,7 +778,7 @@ test canvText-14.3 {GetTextIndex procedure: select error} -setup { .c index test sel.last } -cleanup { .c delete test -} -returnCodes {error} -result {selection isn't in item} +} -returnCodes error -result {selection isn't in item} test canvText-14.4 {GetTextIndex procedure: select error} -setup { .c create text 0 0 -tag test focus .c @@ -786,7 +788,7 @@ test canvText-14.4 {GetTextIndex procedure: select error} -setup { .c index test sel. } -cleanup { .c delete test -} -returnCodes {error} -result {bad index "sel."} +} -returnCodes error -result {bad index "sel."} test canvText-14.5 {GetTextIndex procedure: bad int or unknown index} -setup { .c create text 0 0 -tag test focus .c @@ -795,7 +797,7 @@ test canvText-14.5 {GetTextIndex procedure: bad int or unknown index} -setup { .c index test xyz } -cleanup { .c delete test -} -returnCodes {error} -result {bad index "xyz"} +} -returnCodes error -result {bad index "xyz"} test canvText-14.6 {select clear errors} -setup { .c create text 0 0 -tag test } -body { @@ -906,20 +908,20 @@ test canvText-19.1 {patch 1006286, leading space caused wrap under Win32} -setup set s1 { Yeah-ah-ah-ah-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-Yow} set s2 { Yeah ah ah ah oh oh oh oh oh oh oh oh oh oh oh oh oh oh oh oh Yow} $c create text 21 18 \ - -font $f \ - -text $s1 \ - -fill white \ - -width 922 \ - -anchor nw \ - -tags tbox1 + -font $f \ + -text $s1 \ + -fill white \ + -width 922 \ + -anchor nw \ + -tags tbox1 $c create rect {*}[$c bbox tbox1] -outline red $c create text 21 160 \ - -font $f \ - -text $s2 \ - -fill white \ - -width 922 \ - -anchor nw \ - -tags tbox2 + -font $f \ + -text $s2 \ + -fill white \ + -width 922 \ + -anchor nw \ + -tags tbox2 $c create rect {*}[$c bbox tbox2] -outline red after 500 "set done 1" ; vwait done set results [list] @@ -931,7 +933,7 @@ test canvText-19.1 {patch 1006286, leading space caused wrap under Win32} -setup lappend results [selection get] array set metrics [font metrics $f] set x [expr {21 + [font measure $f " "] \ - + ([font measure {Arial 28 bold} "Y"] / 2)}] + + ([font measure {Arial 28 bold} "Y"] / 2)}] set y1 [expr {18 + ($metrics(-linespace) / 2)}] set y2 [expr {160 + ($metrics(-linespace) / 2)}] lappend results [$c index tbox1 @$x,$y1] @@ -948,10 +950,10 @@ test canvText-20.1 {angled text bounding box} -setup { list $b $a $d $c } proc almosteq {b1 b2} { - # check whether the two boxes are equal, with 1 unit tolerance on each x y w h - lassign $b1 a b c d - lassign $b2 e f g h - expr {($e-$a)<=1 && ($f-$b)<=1 && ($g-$c)<=1 && ($h-$d)<=1} + # check whether the two boxes are equal, with 1 unit tolerance on each x y w h + lassign $b1 a b c d + lassign $b2 e f g h + expr {($e-$a)<=1 && ($f-$b)<=1 && ($g-$c)<=1 && ($h-$d)<=1} } } -body { .c create text 2 2 -tag t -anchor center -text 0 -font {TkDefaultFont 24} diff --git a/tests/canvas.test b/tests/canvas.test index c06e0d2..b0e1379 100644 --- a/tests/canvas.test +++ b/tests/canvas.test @@ -44,7 +44,7 @@ test canvas-1.6 {configuration options: bad value for "bd"} -body { test canvas-1.7 {configuration options: good value for "borderwidth"} -body { .c configure -borderwidth 1.3 .c cget -borderwidth -} -result 1 +} -result 1.3 test canvas-1.8 {configuration options: bad value for "borderwidth"} -body { .c configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} @@ -72,7 +72,7 @@ test canvas-1.14 {configuration options: bad value for "cursor"} -body { test canvas-1.15 {configuration options: good value for "height"} -body { .c configure -height 2.1 .c cget -height -} -result 2 +} -result 2.1 test canvas-1.16 {configuration options: bad value for "height"} -body { .c configure -height x42 } -returnCodes error -result {expected screen distance but got "x42"} @@ -107,7 +107,7 @@ test canvas-1.24 {configuration options: bad value for "insertbackground"} -body test canvas-1.25 {configuration options: good value for "insertborderwidth"} -body { .c configure -insertborderwidth 1.3 .c cget -insertborderwidth -} -result 1 +} -result 1.3 test canvas-1.26 {configuration options: bad value for "insertborderwidth"} -body { .c configure -insertborderwidth 2.6x } -returnCodes error -result {expected screen distance but got "2.6x"} @@ -128,7 +128,7 @@ test canvas-1.30 {configuration options: bad value for "insertontime"} -body { test canvas-1.31 {configuration options: good value for "insertwidth"} -body { .c configure -insertwidth 1.3 .c cget -insertwidth -} -result 1 +} -result 1.3 test canvas-1.32 {configuration options: bad value for "insertwidth"} -body { .c configure -insertwidth 6x } -returnCodes error -result {expected screen distance but got "6x"} @@ -138,7 +138,7 @@ test canvas-1.33 {configuration options: good value for "relief"} -body { } -result {groove} test canvas-1.34 {configuration options: bad value for "relief"} -body { .c configure -relief r -} -returnCodes error -result {bad relief "r": must be flat, groove, raised, ridge, solid, or sunken} +} -returnCodes error -result {ambiguous relief "r": must be flat, groove, raised, ridge, solid, or sunken} test canvas-1.35 {configuration options: good value for "selectbackground"} -body { .c configure -selectbackground #110022 .c cget -selectbackground @@ -149,7 +149,7 @@ test canvas-1.36 {configuration options: bad value for "selectbackground"} -body test canvas-1.37 {configuration options: good value for "selectborderwidth"} -body { .c configure -selectborderwidth 1.3 .c cget -selectborderwidth -} -result 1 +} -result 1.3 test canvas-1.38 {configuration options: bad value for "selectborderwidth"} -body { .c configure -selectborderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} @@ -558,6 +558,13 @@ test canvas-11.3 {canvas poly dchars, bug 3291543} { .c dchars 1 2 end .c coords 1 } {} +test canvas-11.4 {canvas line dchars crash with -arrows, bug 51ece3786f} { + # This would crash + destroy .c + canvas .c + .c create line 10 10 100 100 -arrow last + .c dchars 1 0 1 +} {} test canvas-12.1 {canvas mm obj, patch SF-403327, 102471} -setup { destroy .c @@ -997,7 +1004,7 @@ test canvas-20.1 {addtag/dtag - no shuffling of tag sequence} -setup { .c create text 100 100 -text Hello } -body { for {set i 1} {$i < 5} {incr i} { - .c addtag tag$i all + .c addtag tag$i all } # [.c addtags] only adds tags that are not already present .c addtag tag1 all ; # no effect @@ -1221,12 +1228,12 @@ test canvas-22.9 {canvas rotate: window item rotation behaviour} -setup { proc matchPixels {pixels expected} { set matched 1 foreach pline $pixels eline $expected { - foreach ppixel $pline epixel $eline { - if {$ppixel != $epixel} { - set matched 0 - break - } - } + foreach ppixel $pline epixel $eline { + if {$ppixel != $epixel} { + set matched 0 + break + } + } } return $matched } @@ -1239,16 +1246,16 @@ test canvas-23.1 {canvas image} -setup { .c create rectangle 0 0 0 9 -fill #000080 -outline #000080 .c image testimage matchPixels [testimage data] { \ - {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0}} + {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#000080 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0}} } -cleanup { destroy .c image delete testimage @@ -1262,11 +1269,11 @@ test canvas-23.2 {canvas image with subsample} -setup { .c create rectangle 0 0 1 9 -fill #008000 -outline #008000 .c image testimage 2 matchPixels [testimage data] { \ - {#008000 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#008000 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#008000 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#008000 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#008000 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0}} + {#008000 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#008000 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#008000 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#008000 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#008000 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0}} } -cleanup { destroy .c image delete testimage @@ -1280,26 +1287,26 @@ test canvas-23.3 {canvas image with subsample and zoom} -setup { .c create rectangle 0 0 9 0 -fill #800000 -outline #800000 .c image testimage 1 2 matchPixels [testimage data] { \ - {#800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000} \ - {#800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ - {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0}} + {#800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000} \ + {#800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000 #800000} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0} \ + {#c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0 #c0c0c0}} } -cleanup { destroy .c image delete testimage diff --git a/tests/cmds.test b/tests/cmds.test index 3ccd587..8a1ff2a 100644 --- a/tests/cmds.test +++ b/tests/cmds.test @@ -14,13 +14,13 @@ update test cmds-1.1 {tkwait visibility, argument errors} -body { tkwait visibility -} -returnCodes {error} -result {wrong # args: should be "tkwait variable|visibility|window name"} +} -returnCodes error -result {wrong # args: should be "tkwait variable|visibility|window name"} test cmds-1.2 {tkwait visibility, argument errors} -body { tkwait visibility foo bar -} -returnCodes {error} -result {wrong # args: should be "tkwait variable|visibility|window name"} +} -returnCodes error -result {wrong # args: should be "tkwait variable|visibility|window name"} test cmds-1.3 {tkwait visibility, argument errors} -body { tkwait visibility bad_window -} -returnCodes {error} -result {bad window path name "bad_window"} +} -returnCodes error -result {bad window path name "bad_window"} test cmds-1.4 {tkwait visibility, waiting for window to be mapped} -setup { button .b -text "Test" set x init @@ -39,7 +39,7 @@ test cmds-1.5 {tkwait visibility, window gets deleted} -setup { } -body { after 100 {set x deleted; destroy .f} tkwait visibility .f.b -} -returnCodes {error} -result {window ".f.b" was deleted before its visibility changed} +} -returnCodes error -result {window ".f.b" was deleted before its visibility changed} test cmds-1.6 {tkwait visibility, window gets deleted} -setup { frame .f button .f.b -text "Test" diff --git a/tests/config.test b/tests/config.test index 5621e92..6c27608 100644 --- a/tests/config.test +++ b/tests/config.test @@ -19,7 +19,7 @@ proc killTables {} { foreach t {alltypes chain3 chain2 chain1 configerror internal new notenoughparams twowindows} { while {[testobjconfig info $t] != ""} { - testobjconfig delete $t + testobjconfig delete $t } } } @@ -1289,7 +1289,7 @@ test config-8.1 {Tk_RestoreSavedOptions - restore in proper order} -constraints } -body { testobjconfig alltypes .a .a csave -color green -color black -color blue \ - -color #ffff00 -color #ff00ff -color bogus \ + -color #ffff00 -color #ff00ff -color bogus \ } -cleanup { killTables } -returnCodes error -result {unknown color name "bogus"} @@ -1766,10 +1766,10 @@ test config-14.1 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::button - ::foo::button .a - ::foo::button .b - } + namespace import -force ::button + ::foo::button .a + ::foo::button .b + } ] destroy .a .b } -result {} @@ -1777,10 +1777,10 @@ test config-14.2 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::canvas - ::foo::canvas .a - ::foo::canvas .b - } + namespace import -force ::canvas + ::foo::canvas .a + ::foo::canvas .b + } ] destroy .a .b } -result {} @@ -1788,10 +1788,10 @@ test config-14.3 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::entry - ::foo::entry .a - ::foo::entry .b - } + namespace import -force ::entry + ::foo::entry .a + ::foo::entry .b + } ] destroy .a .b } -result {} @@ -1799,10 +1799,10 @@ test config-14.4 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::frame - ::foo::frame .a - ::foo::frame .b - } + namespace import -force ::frame + ::foo::frame .a + ::foo::frame .b + } ] destroy .a .b } -result {} @@ -1810,10 +1810,10 @@ test config-14.5 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::listbox - ::foo::listbox .a - ::foo::listbox .b - } + namespace import -force ::listbox + ::foo::listbox .a + ::foo::listbox .b + } ] destroy .a .b } -result {} @@ -1821,10 +1821,10 @@ test config-14.6 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::menu - ::foo::menu .a - ::foo::menu .b - } + namespace import -force ::menu + ::foo::menu .a + ::foo::menu .b + } ] destroy .a .b } -result {} @@ -1832,10 +1832,10 @@ test config-14.7 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::menubutton - ::foo::menubutton .a - ::foo::menubutton .b - } + namespace import -force ::menubutton + ::foo::menubutton .a + ::foo::menubutton .b + } ] destroy .a .b } -result {} @@ -1843,10 +1843,10 @@ test config-14.8 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::message - ::foo::message .a - ::foo::message .b - } + namespace import -force ::message + ::foo::message .a + ::foo::message .b + } ] destroy .a .b } -result {} @@ -1854,10 +1854,10 @@ test config-14.9 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::scale - ::foo::scale .a - ::foo::scale .b - } + namespace import -force ::scale + ::foo::scale .a + ::foo::scale .b + } ] destroy .a .b } -result {} @@ -1865,10 +1865,10 @@ test config-14.10 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::scrollbar - ::foo::scrollbar .a - ::foo::scrollbar .b - } + namespace import -force ::scrollbar + ::foo::scrollbar .a + ::foo::scrollbar .b + } ] destroy .a .b } -result {} @@ -1876,10 +1876,10 @@ test config-14.11 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::spinbox - ::foo::spinbox .a - ::foo::spinbox .b - } + namespace import -force ::spinbox + ::foo::spinbox .a + ::foo::spinbox .b + } ] destroy .a .b } -result {} @@ -1887,10 +1887,10 @@ test config-14.12 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::text - ::foo::text .a - ::foo::text .b - } + namespace import -force ::text + ::foo::text .a + ::foo::text .b + } ] destroy .a .b } -result {} @@ -1898,10 +1898,10 @@ test config-14.13 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::radiobutton - ::foo::radiobutton .a - ::foo::radiobutton .b - } + namespace import -force ::radiobutton + ::foo::radiobutton .a + ::foo::radiobutton .b + } ] destroy .a .b } -result {} @@ -1909,10 +1909,10 @@ test config-14.14 {Tk_CreateOptionTable - use with namespace import} -setup { namespace export -clear * } -body { namespace eval ::foo [subst { - namespace import -force ::checkbutton - ::foo::checkbutton .a - ::foo::checkbutton .b - } + namespace import -force ::checkbutton + ::foo::checkbutton .a + ::foo::checkbutton .b + } ] destroy .a .b } -result {} diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 8cc1a18..8e61610 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -132,51 +132,51 @@ namespace eval tk { namespace export fixfocus proc fixfocus {} { - catch {destroy .focus} - toplevel .focus - wm geometry .focus +0+0 - entry .focus.e - .focus.e insert 0 "fixfocus" - pack .focus.e - update - focus -force .focus.e - destroy .focus + catch {destroy .focus} + toplevel .focus + wm geometry .focus +0+0 + entry .focus.e + .focus.e insert 0 "fixfocus" + pack .focus.e + update + focus -force .focus.e + destroy .focus } - namespace export imageInit imageFinish imageCleanup imageNames - variable ImageNames - proc imageInit {} { - variable ImageNames - if {![info exists ImageNames]} { - set ImageNames [lsearch -all -inline -glob -not [lsort [image names]] ::tk::icons::indicator*] - } - imageCleanup - if {[lsort [image names]] ne $ImageNames} { - return -code error "IMAGE NAMES mismatch: [image names] != $ImageNames" - } - } - proc imageFinish {} { - variable ImageNames + namespace export imageInit imageFinish imageCleanup imageNames + variable ImageNames + proc imageInit {} { + variable ImageNames + if {![info exists ImageNames]} { + set ImageNames [lsearch -all -inline -glob -not [lsort [image names]] ::tk::icons::indicator*] + } + imageCleanup + if {[lsort [image names]] ne $ImageNames} { + return -code error "IMAGE NAMES mismatch: [image names] != $ImageNames" + } + } + proc imageFinish {} { + variable ImageNames set imgs [lsearch -all -inline -glob -not [lsort [image names]] ::tk::icons::indicator*] - if {$imgs ne $ImageNames} { - return -code error "images remaining: [image names] != $ImageNames" - } - imageCleanup - } - proc imageCleanup {} { - variable ImageNames - foreach img [image names] { - if {$img ni $ImageNames} {image delete $img} - } - } - proc imageNames {} { - variable ImageNames - set r {} - foreach img [image names] { - if {$img ni $ImageNames} {lappend r $img} - } - return $r - } + if {$imgs ne $ImageNames} { + return -code error "images remaining: [image names] != $ImageNames" + } + imageCleanup + } + proc imageCleanup {} { + variable ImageNames + foreach img [image names] { + if {$img ni $ImageNames} {image delete $img} + } + } + proc imageNames {} { + variable ImageNames + set r {} + foreach img [image names] { + if {$img ni $ImageNames} {lappend r $img} + } + return $r + } # # CONTROL TIMING ASPECTS OF POINTER WARPING @@ -368,8 +368,8 @@ testConstraint secureserver 0 if {[llength [info commands send]]} { testConstraint secureserver 1 if {[catch {send $app set a 0} msg] == 1} { - if {[string match "X server insecure *" $msg]} { - testConstraint secureserver 0 + if {[string match "X server insecure *" $msg]} { + testConstraint secureserver 0 } } } diff --git a/tests/dialog.test b/tests/dialog.test index 692d928..a7c1ac9 100644 --- a/tests/dialog.test +++ b/tests/dialog.test @@ -21,12 +21,12 @@ test dialog-1.3 {tk_dialog command} -body { test dialog-2.1 {tk_dialog operation} -setup { proc PressButton {btn} { - if {![winfo ismapped $btn]} { - update - } - event generate $btn <Enter> - event generate $btn <Button-1> -x 5 -y 5 - event generate $btn <ButtonRelease-1> -x 5 -y 5 + if {![winfo ismapped $btn]} { + update + } + event generate $btn <Enter> + event generate $btn <Button-1> -x 5 -y 5 + event generate $btn <ButtonRelease-1> -x 5 -y 5 } } -body { set x [after 5000 [list set tk::Priv(button) "no response"]] @@ -39,9 +39,9 @@ test dialog-2.1 {tk_dialog operation} -setup { } -result 0 test dialog-2.2 {tk_dialog operation} -setup { proc HitReturn {w} { - event generate $w <Enter> - focus -force $w - event generate $w <Key> -keysym Return + event generate $w <Enter> + focus -force $w + event generate $w <Key> -keysym Return } } -body { set x [after 5000 [list set tk::Priv(button) "no response"]] diff --git a/tests/entry.test b/tests/entry.test index 1454104..82259b1 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -14,28 +14,28 @@ tcltest::loadTestedCommands # For xscrollcommand set scrollInfo {} proc scroll args { - global scrollInfo - set scrollInfo $args + global scrollInfo + set scrollInfo $args } # For trace add variable proc override args { - global x - set x 12345 + global x + set x 12345 } # Procedures used in widget VALIDATION tests proc doval {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 1 + set ::vVals [list $W $d $i $P $s $S $v $V] + return 1 } proc doval2 {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - set ::e mydata - return 1 + set ::vVals [list $W $d $i $P $s $S $v $V] + set ::e mydata + return 1 } proc doval3 {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 0 + set ::vVals [list $W $d $i $P $s $S $v $V] + return 0 } set cy [font metrics {Courier -12} -linespace] @@ -59,7 +59,7 @@ test entry-1.2 {configuration option: "background" for entry} -setup { .e configure -background non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.3 {configuration option: "bd" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -79,7 +79,7 @@ test entry-1.4 {configuration option: "bd" for entry} -setup { .e configure -bd badValue } -cleanup { destroy .e -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test entry-1.5 {configuration option: "bg" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -99,7 +99,7 @@ test entry-1.6 {configuration option: "bg" for entry} -setup { .e configure -bg non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.7 {configuration option: "borderwidth" for entry} -setup { entry .e -highlightthickness 2 -font {Helvetica -12 bold} @@ -110,7 +110,7 @@ test entry-1.7 {configuration option: "borderwidth" for entry} -setup { .e cget -borderwidth } -cleanup { destroy .e -} -result 1 +} -result 1.3 test entry-1.8 {configuration option: "borderwidth" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .e ; update idletasks @@ -119,7 +119,7 @@ test entry-1.8 {configuration option: "borderwidth" for entry} -setup { .e configure -borderwidth badValue } -cleanup { destroy .e -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test entry-1.9 {configuration option: "cursor" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -139,7 +139,7 @@ test entry-1.10 {configuration option: "cursor" for entry} -setup { .e configure -cursor badValue } -cleanup { destroy .e -} -returnCodes {error} -result {bad cursor spec "badValue"} +} -returnCodes error -result {bad cursor spec "badValue"} test entry-1.11 {configuration option: "disabledbackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -159,7 +159,7 @@ test entry-1.12 {configuration option: "disabledbackground" for entry} -setup { .e configure -disabledbackground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.13 {configuration option: "disabledforeground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -179,7 +179,7 @@ test entry-1.14 {configuration option: "disabledforeground" for entry} -setup { .e configure -disabledforeground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.15 {configuration option: "exportselection" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -199,7 +199,7 @@ test entry-1.16 {configuration option: "exportselection" for entry} -setup { .e configure -exportselection xyzzy } -cleanup { destroy .e -} -returnCodes {error} -result {expected boolean value but got "xyzzy"} +} -returnCodes error -result {expected boolean value but got "xyzzy"} test entry-1.17 {configuration option: "fg" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -219,7 +219,7 @@ test entry-1.18 {configuration option: "fg" for entry} -setup { .e configure -fg non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.19 {configuration option: "font" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 @@ -239,7 +239,7 @@ test entry-1.20 {configuration option: "font" for entry} -setup { .e configure -font {} } -cleanup { destroy .e -} -returnCodes {error} -result {font "" doesn't exist} +} -returnCodes error -result {font "" does not exist} test entry-1.21 {configuration option: "foreground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -259,7 +259,7 @@ test entry-1.22 {configuration option: "foreground" for entry} -setup { .e configure -foreground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.23 {configuration option: "highlightbackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -279,7 +279,7 @@ test entry-1.24 {configuration option: "highlightbackground" for entry} -setup { .e configure -highlightbackground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.25 {configuration option: "highlightcolor" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -299,7 +299,7 @@ test entry-1.26 {configuration option: "highlightcolor" for entry} -setup { .e configure -highlightcolor non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.27 {configuration option: "highlightthickness" for entry} -setup { entry .e -borderwidth 2 -font {Helvetica -12 bold} @@ -329,7 +329,7 @@ test entry-1.29 {configuration option: "highlightthickness" for entry} -setup { .e configure -highlightthickness badValue } -cleanup { destroy .e -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test entry-1.30 {configuration option: "insertbackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -349,7 +349,7 @@ test entry-1.31 {configuration option: "insertbackground" for entry} -setup { .e configure -insertbackground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.32 {configuration option: "insertborderwidth" for entry} -setup { entry .e -borderwidth 2 -insertwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -360,7 +360,7 @@ test entry-1.32 {configuration option: "insertborderwidth" for entry} -setup { .e cget -insertborderwidth } -cleanup { destroy .e -} -result 1 +} -result 1.3 test entry-1.33 {configuration option: "insertborderwidth" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .e ; update idletasks @@ -369,7 +369,7 @@ test entry-1.33 {configuration option: "insertborderwidth" for entry} -setup { .e configure -insertborderwidth 2.6x } -cleanup { destroy .e -} -returnCodes {error} -result {expected screen distance but got "2.6x"} +} -returnCodes error -result {expected screen distance but got "2.6x"} test entry-1.34 {configuration option: "insertofftime" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -389,7 +389,7 @@ test entry-1.35 {configuration option: "insertofftime" for entry} -setup { .e configure -insertofftime 3.2 } -cleanup { destroy .e -} -returnCodes {error} -result {expected integer but got "3.2"} +} -returnCodes error -result {expected integer but got "3.2"} test entry-1.36 {configuration option: "insertontime" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -409,7 +409,7 @@ test entry-1.37 {configuration option: "insertontime" for entry} -setup { .e configure -insertontime 3.2 } -cleanup { destroy .e -} -returnCodes {error} -result {expected integer but got "3.2"} +} -returnCodes error -result {expected integer but got "3.2"} test entry-1.38 {configuration option: "invalidcommand" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -451,7 +451,7 @@ test entry-1.41 {configuration option: "justify" for entry} -setup { .e configure -justify bogus } -cleanup { destroy .e -} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} +} -returnCodes error -result {bad justification "bogus": must be left, right, or center} test entry-1.42 {configuration option: "readonlybackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -471,7 +471,7 @@ test entry-1.43 {configuration option: "readonlybackground" for entry} -setup { .e configure -readonlybackground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.44 {configuration option: "relief" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -502,7 +502,7 @@ test entry-1.46 {configuration option: "selectbackground" for entry} -setup { .e configure -selectbackground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.47 {configuration option: "selectborderwidth" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -513,7 +513,7 @@ test entry-1.47 {configuration option: "selectborderwidth" for entry} -setup { .e cget -selectborderwidth } -cleanup { destroy .e -} -result 1 +} -result 1.3 test entry-1.48 {configuration option: "selectborderwidth" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .e ; update idletasks @@ -522,7 +522,7 @@ test entry-1.48 {configuration option: "selectborderwidth" for entry} -setup { .e configure -selectborderwidth badValue } -cleanup { destroy .e -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test entry-1.49 {configuration option: "selectforeground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -542,7 +542,7 @@ test entry-1.50 {configuration option: "selectforeground" for entry} -setup { .e configure -selectforeground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test entry-1.51 {configuration option: "show" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -573,7 +573,7 @@ test entry-1.53 {configuration option: "state" for entry} -setup { .e configure -state bogus } -cleanup { destroy .e -} -returnCodes {error} -result {bad state "bogus": must be disabled, normal, or readonly} +} -returnCodes error -result {bad state "bogus": must be disabled, normal, or readonly} test entry-1.54 {configuration option: "takefocus" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -615,7 +615,7 @@ test entry-1.57 {configuration option: "width" for entry} -setup { .e configure -width 3p } -cleanup { destroy .e -} -returnCodes {error} -result {expected integer but got "3p"} +} -returnCodes error -result {expected integer but got "3p"} test entry-1.58 {configuration option: "xscrollcommand" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -1761,7 +1761,7 @@ test entry-6.1 {EntryComputeGeometry procedure} -constraints { pack .e ; update idletasks } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ - -highlightthickness 3 + -highlightthickness 3 .e insert end 012\t45 update list [.e index @61] [.e index @62] @@ -1775,7 +1775,7 @@ test entry-6.2 {EntryComputeGeometry procedure} -constraints { pack .e ; update idletasks } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ - -justify center -highlightthickness 3 + -justify center -highlightthickness 3 .e insert end 012\t45 update list [.e index @96] [.e index @97] @@ -1789,7 +1789,7 @@ test entry-6.3 {EntryComputeGeometry procedure} -constraints { pack .e ; update idletasks } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ - -justify right -highlightthickness 3 + -justify right -highlightthickness 3 .e insert end 012\t45 update list [.e index @131] [.e index @132] @@ -2342,8 +2342,8 @@ test entry-8.18 {DeleteChars procedure} -setup { # note: XPAD corresponds to the hardcoded #define XPAD 1 set XPAD 1 set expected [expr { [font measure [.e cget -font] "xyy"] \ - + 2 * ( [.e cget -borderwidth] + \ - [.e cget -highlightthickness] + $XPAD ) } ] + + 2 * ( [.e cget -borderwidth] + \ + [.e cget -highlightthickness] + $XPAD ) } ] expr {[winfo reqwidth .e] == $expected} } -cleanup { destroy .e @@ -2754,7 +2754,7 @@ test entry-13.15 {GetEntryIndex procedure} -body { test entry-13.16 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 @@ -2765,7 +2765,7 @@ test entry-13.16 {GetEntryIndex procedure} -constraints fonts -body { } -result 4 test entry-13.17 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 @@ -2776,7 +2776,7 @@ test entry-13.17 {GetEntryIndex procedure} -constraints fonts -body { } -result 4 test entry-13.18 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 @@ -2787,7 +2787,7 @@ test entry-13.18 {GetEntryIndex procedure} -constraints fonts -body { } -result 5 test entry-13.19 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 @@ -2798,7 +2798,7 @@ test entry-13.19 {GetEntryIndex procedure} -constraints fonts -body { } -result 8 test entry-13.20 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 @@ -2809,7 +2809,7 @@ test entry-13.20 {GetEntryIndex procedure} -constraints fonts -body { } -result 9 test entry-13.21 {GetEntryIndex procedure} -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 @@ -2829,7 +2829,7 @@ test entry-13.22 {GetEntryIndex procedure} -setup { } -returnCodes error -result {bad entry index "1xyz"} test entry-13.23 {GetEntryIndex procedure} -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 @@ -2840,7 +2840,7 @@ test entry-13.23 {GetEntryIndex procedure} -body { } -result 0 test entry-13.24 {GetEntryIndex procedure} -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 @@ -2851,7 +2851,7 @@ test entry-13.24 {GetEntryIndex procedure} -body { } -result 12 test entry-13.25 {GetEntryIndex procedure} -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 @@ -2896,7 +2896,7 @@ test entry-14.2 {EntryFetchSelection procedure} -body { test entry-14.3 {EntryFetchSelection procedure} -setup { set x {} for {set i 1} {$i <= 500} {incr i} { - append x "This is line $i, out of 500\n" + append x "This is line $i, out of 500\n" } } -body { entry .e @@ -3045,10 +3045,10 @@ test entry-19.1 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert 0 a set ::vVals @@ -3060,10 +3060,10 @@ test entry-19.2 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert 0 a ;# previous settings .e insert 1 b @@ -3076,10 +3076,10 @@ test entry-19.3 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert 0 ab ;# previous settings .e insert end c @@ -3092,10 +3092,10 @@ test entry-19.4 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert 0 abc ;# previous settings .e insert 1 123 @@ -3108,10 +3108,10 @@ test entry-19.5 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert 0 a123bc ;# previous settings .e delete 2 @@ -3124,10 +3124,10 @@ test entry-19.6 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert 0 a13bc ;# previous settings .e configure -validate key @@ -3141,10 +3141,10 @@ test entry-19.7 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate focus \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert end abc ;# previous settings set ::vVals {} @@ -3158,10 +3158,10 @@ test entry-19.8 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e configure -validate focus ;# previous settings .e insert end abcd ;# previous settings @@ -3177,10 +3177,10 @@ test entry-19.9 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate focus \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert end abcd ;# previous settings focus -force .e ;# previous settings @@ -3198,10 +3198,10 @@ test entry-19.10 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert end abcd ;# previous settings focus -force .e @@ -3216,10 +3216,10 @@ test entry-19.11 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert end abcd ;# previous settings focus -force .e ;# previous settings @@ -3237,10 +3237,10 @@ test entry-19.12 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate focusin \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert 0 abcd ;# previous settings focus -force .e @@ -3255,10 +3255,10 @@ test entry-19.13 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate focusin \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert end abcd ;# previous settings set ::vVals {} @@ -3274,10 +3274,10 @@ test entry-19.14 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate focuso \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert end abcd ;# previous settings set ::vVals {} ;# previous settings @@ -3293,10 +3293,10 @@ test entry-19.15 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate focuso \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert end abcd ;# previous settings set ::vVals {} ;# previous settings @@ -3316,10 +3316,10 @@ test entry-19.16 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate focuso \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert end abcd ;# previous settings set ::vVals {} ;# previous settings @@ -3339,10 +3339,10 @@ test entry-19.17 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate focuso \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks .e insert end abcd ;# previous settings set ::e newdata @@ -3357,10 +3357,10 @@ test entry-19.18 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks set ::e newdata ;# previous settings .e configure -validate all @@ -3377,10 +3377,10 @@ test entry-19.19 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks set ::e nextdata ;# previous settings @@ -3400,10 +3400,10 @@ test entry-19.20 {entry widget validation} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e ; update idletasks set ::e nextdata ;# previous settings .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] ;# prev @@ -3425,8 +3425,8 @@ test entry-19.21 {entry widget validation - bug 40e4bf6198} -setup { unset -nocomplain ::e ::vVals } -body { entry .e -validate key \ - -validatecommand [list doval2 %W %d %i %P %s %S %v %V] \ - -textvariable ::e + -validatecommand [list doval2 %W %d %i %P %s %S %v %V] \ + -textvariable ::e pack .e ; update idletasks set ::e origdata .e insert 0 A @@ -3576,7 +3576,7 @@ test entry-25.1 {Bug [5d991b822e]} { set var INIT entry .b -textvariable var trace add variable var unset {apply {args { - .b configure -textvariable {} + .b configure -textvariable {} }}} pack .b bind .b <Configure> {unset var} @@ -3589,7 +3589,7 @@ test entry-25.2 {Bug [5d991b822e]} { set var INIT entry .b -textvariable var trace add variable var unset {apply {args { - .b configure -textvariable new + .b configure -textvariable new }}} pack .b bind .b <Configure> {unset -nocomplain var} diff --git a/tests/event.test b/tests/event.test index c56d4d8..3cef258 100644 --- a/tests/event.test +++ b/tests/event.test @@ -51,17 +51,17 @@ proc _keypress_lookup {char} { global keypress_lookup if {! [info exists keypress_lookup]} { - _init_keypress_lookup + _init_keypress_lookup } if {$char == ""} { - error "empty char" + error "empty char" } if {[info exists keypress_lookup($char)]} { - return $keypress_lookup($char) + return $keypress_lookup($char) } else { - return $char + return $char } } @@ -76,12 +76,12 @@ proc _keypress {win key} { # the focus if the mouse is moved around. if {[focus] != $win} { - focus -force $win + focus -force $win } event generate $win <Key-$keysym> _pause 50 if {[focus] != $win} { - focus -force $win + focus -force $win } event generate $win <KeyRelease-$keysym> _pause 50 @@ -91,7 +91,7 @@ proc _keypress {win key} { proc _keypress_string {win string} { foreach letter [split $string ""] { - _keypress $win $letter + _keypress $win $letter } } @@ -101,7 +101,7 @@ proc _pause {{msecs 1000}} { global _pause if {! [info exists _pause(number)]} { - set _pause(number) 0 + set _pause(number) 0 } set num [incr _pause(number)] @@ -117,7 +117,7 @@ proc _pause {{msecs 1000}} { proc _text_ind_to_x_y {text ind} { set bbox [$text bbox $ind] if {[llength $bbox] != 4} { - error "got bbox \{$bbox\} from $text, index $ind" + error "got bbox \{$bbox\} from $text, index $ind" } foreach {x1 y1 width height} $bbox break set middle_y [expr {$y1 + ($height / 2)}] @@ -128,10 +128,10 @@ proc _text_ind_to_x_y {text ind} { proc _get_selection {widget} { if {[string compare $widget [selection own]] != 0} { - return "" + return "" } if {[catch {selection get} sel]} { - return "" + return "" } return $sel } @@ -209,7 +209,7 @@ test event-2.2(keypress) {type into entry widget and then delete some text} -set deleteWindows } -result {MEL} test event-2.3(keypress) {type into entry widget, triple click, hit Delete key, - and then type some more} -setup { + and then type some more} -setup { deleteWindows } -body { set t [toplevel .t] @@ -222,10 +222,10 @@ test event-2.3(keypress) {type into entry widget, triple click, hit Delete key, event generate $e <Enter> for {set i 0} {$i < 3} {incr i} { - _pause 100 - event generate $e <Button-1> - _pause 100 - event generate $e <ButtonRelease-1> + _pause 100 + event generate $e <Button-1> + _pause 100 + event generate $e <ButtonRelease-1> } _keypress $e Delete @@ -265,6 +265,7 @@ test event-2.5(keypress) {type into text widget and then delete some text} -setu test event-2.6(keypress) {type into text widget, triple click, hit Delete key, and then type some more} -setup { deleteWindows + update idletasks } -body { set t [toplevel .t] set e [text $t.e] @@ -276,10 +277,10 @@ test event-2.6(keypress) {type into text widget, triple click, event generate $e <Enter> for {set i 0} {$i < 3} {incr i} { - _pause 100 - event generate $e <Button-1> - _pause 100 - event generate $e <ButtonRelease-1> + _pause 100 + event generate $e <Button-1> + _pause 100 + event generate $e <ButtonRelease-1> } _keypress $e Delete @@ -318,10 +319,10 @@ test event-3.1(click-drag) {click and drag in a text widget, this tests set current $anchor while {[$e compare $current <= $selend]} { - foreach {current_x current_y} [_text_ind_to_x_y $e $current] break - event generate $e <B1-Motion> -x $current_x -y $current_y - set current [$e index [list $current + 1 char]] - _pause 50 + foreach {current_x current_y} [_text_ind_to_x_y $e $current] break + event generate $e <B1-Motion> -x $current_x -y $current_y + set current [$e index [list $current + 1 char]] + _pause 50 } event generate $e <ButtonRelease-1> -x $current_x -y $current_y @@ -338,10 +339,10 @@ test event-3.1(click-drag) {click and drag in a text widget, this tests event generate $e <Button-1> -x $current_x -y $current_y while {[$e compare $current >= [list $anchor - 4 char]]} { - foreach {current_x current_y} [_text_ind_to_x_y $e $current] break - event generate $e <B1-Motion> -x $current_x -y $current_y - set current [$e index [list $current - 1 char]] - _pause 50 + foreach {current_x current_y} [_text_ind_to_x_y $e $current] break + event generate $e <B1-Motion> -x $current_x -y $current_y + set current [$e index [list $current - 1 char]] + _pause 50 } event generate $e <ButtonRelease-1> -x $current_x -y $current_y @@ -385,10 +386,10 @@ test event-3.1(click-drag) {click and drag in a text widget, this tests set current $anchor while {$current <= $selend} { - foreach {current_x current_y} [_text_ind_to_x_y $e $current] break - event generate $e <B1-Motion> -x $current_x -y $current_y - incr current - _pause 50 + foreach {current_x current_y} [_text_ind_to_x_y $e $current] break + event generate $e <B1-Motion> -x $current_x -y $current_y + incr current + _pause 50 } event generate $e <ButtonRelease-1> -x $current_x -y $current_y @@ -405,10 +406,10 @@ test event-3.1(click-drag) {click and drag in a text widget, this tests event generate $e <Button-1> -x $current_x -y $current_y while {$current >= ($anchor - 4)} { - foreach {current_x current_y} [_text_ind_to_x_y $e $current] break - event generate $e <B1-Motion> -x $current_x -y $current_y - incr current -1 - _pause 50 + foreach {current_x current_y} [_text_ind_to_x_y $e $current] break + event generate $e <B1-Motion> -x $current_x -y $current_y + incr current -1 + _pause 50 } event generate $e <ButtonRelease-1> -x $current_x -y $current_y @@ -567,7 +568,7 @@ test event-4.2(double-click-drag) {click down, click up, click down again, } -result {select 11 7 select 4 { select} {Word select} 2} test event-5.1(triple-click-drag) {Triple click and drag across lines in a - text widget, this should extend the selection to the new line} -setup { + text widget, this should extend the selection to the new line} -setup { deleteWindows } -body { set t [toplevel .t] @@ -624,12 +625,12 @@ test event-5.1(triple-click-drag) {Triple click and drag across lines in a } -cleanup { deleteWindows } -result [list "LINE THREE\n" "LINE TWO\nLINE THREE\n" \ - "LINE ONE\nLINE TWO\nLINE THREE\n"] + "LINE ONE\nLINE TWO\nLINE THREE\n"] test event-6.1(button-state) {button press in a window that is then - destroyed, when the mouse is moved into another window it - should not generate a <B1-motion> event since the mouse - was not pressed down in that window} -setup { + destroyed, when the mouse is moved into another window it + should not generate a <B1-motion> event since the mouse + was not pressed down in that window} -setup { deleteWindows } -body { set t [toplevel .t] @@ -781,8 +782,8 @@ test event-7.2(double-click) {A double click on a lone character } -result {4 A 4 A} test event-8 {event generate with keysyms corresponding to - multi-byte virtual keycodes - bug - e36963bfe8df9f5e528134707a91b9c0051de723} -constraints nonPortable -setup { + multi-byte virtual keycodes - bug + e36963bfe8df9f5e528134707a91b9c0051de723} -constraints nonPortable -setup { deleteWindows set res [list ] } -body { @@ -803,13 +804,13 @@ test event-8 {event generate with keysyms corresponding to # (system-independent) known keysym, unless the system # running the test does not have a keyboard with a # diaeresis key. - if {[expr {[lindex $res 3] ne "??"}]} { - # keyboard has a physical diaeresis key and bug is fixed - return "OK" + if {[lindex $res 3] ne "??"} { + # keyboard has a physical diaeresis key and bug is fixed + return "OK" } else { - return "Test failed, unless the keyboard tied to the system \ - on which this test is run does NOT have a diaeresis \ - physical key - in this case, test is actually void." + return "Test failed, unless the keyboard tied to the system \ + on which this test is run does NOT have a diaeresis \ + physical key - in this case, test is actually void." } } -cleanup { deleteWindows @@ -840,12 +841,18 @@ test event-9.1 {enter . window by destroying a toplevel - bug b1d115fa60} -setup deleteWindows bind . <Enter> $EnterBind } -result {.} -test event-9.2 {enter toplevel window by destroying a toplevel - bug b1d115fa60} -setup { + +# This test fails sporadically when run on the macOS CI runner. It does +# not seem to fail on real computers. It is not needed since the same +# thing is tested by 9.13. So it is simpler to constrain it as notAqua. +test event-9.2 {enter toplevel window by destroying a toplevel - bug b1d115fa60} \ +-constraints { notAqua} \ +-setup { set iconified false if {[winfo ismapped .]} { - wm iconify . - update - set iconified true + wm iconify . + update + set iconified true } } -body { toplevel .top1 @@ -869,12 +876,318 @@ test event-9.2 {enter toplevel window by destroying a toplevel - bug b1d115fa60} } -cleanup { deleteWindows ; # destroy all children of ".", this already includes .top1 if {$iconified} { - wm deiconify . - update + wm deiconify . + update } } -result {.top1} +proc waitForWindowEvent {w event {timeout 1000}} { +# This proc is intended to overcome latency of windowing system +# notifications when toplevel windows are involved. These latencies vary +# considerably with the window manager in use, with the system load, +# with configured scheduling priorities for processes, etc ... +# Waiting for the corresponding window events evades the trouble that is +# associated with the alternative: waiting or halting the Tk process for a +# fixed amount of time (using "after ms"). With the latter strategy it's +# always a gamble how much waiting time is enough on an end user's system. +# It also leads to long fixed waiting times in order to be on the safe side. + + variable _windowEvent + + # Use counter as a unique ID to prevent subsequent waits + # from interfering with each other. + set counter [incr _windowEvent(counter)] + set _windowEvent($counter) 1 + set savedBinding [bind $w $event] + bind $w $event [list +waitForWindowEvent.signal $counter] + set afterID [after $timeout [list set _windowEvent($counter) -1]] + vwait _windowEvent($counter) + set late [expr {$_windowEvent($counter) == -1}] + bind $w $event $savedBinding + unset _windowEvent($counter) + if {$late} { + puts stderr "wait for $event event on $w timed out (> $timeout ms)" + } else { + after cancel $afterID + } +} +proc waitForWindowEvent.signal {counter} { +# Helper proc that records the triggering of a window event. + incr ::_windowEvent($counter) +} + +proc create_and_pack_frames {{w {}}} { + frame $w.f1 -bg blue -width 200 -height 200 + pack propagate $w.f1 0 + frame $w.f1.f2 -bg yellow -width 100 -height 100 + pack $w.f1.f2 $w.f1 -side bottom -anchor se + update idletasks +} + +proc setup_win_mousepointer {w} { +# Position the window and the mouse pointer as an initial state for some tests. +# The so-called "pointer window" is the $w window that will now contain the mouse pointer. + wm geometry . +700+400; # root window out of our way - must not cover windows from event-9.1* + toplevel $w + pack propagate $w 0 + wm geometry $w 300x300+100+100 + tkwait visibility $w + update; # service remaining screen drawing events (e.g. <Expose>) + set pointerWin [winfo containing [winfo pointerx $w] [winfo pointery $w]] + event generate $w <Motion> -warp 1 -x 250 -y 250 + if {($pointerWin ne $w) && ([tk windowingsystem] ne "aqua")} { + waitForWindowEvent $w <Enter> + } else { + controlPointerWarpTiming + } +} + +test event-9.11 {pointer window container = parent} -setup { + setup_win_mousepointer .one + wm withdraw .one + create_and_pack_frames .one + wm deiconify .one + tkwait visibility .one.f1.f2 + _pause 200; # needed for Windows + update idletasks; # finish display of window + set result "|" +} -body { + bind all <Leave> {append result "<Leave> %d %W|"} + bind all <Enter> {append result "<Enter> %d %W|"} + destroy .one.f1.f2 + update + set result +} -cleanup { + bind all <Leave> {} + bind all <Enter> {} + destroy .one + unset result +} -result {|<Enter> NotifyInferior .one.f1|} + +test event-9.12 {pointer window container != parent} -setup { + setup_win_mousepointer .one + wm withdraw .one + create_and_pack_frames .one + pack propagate .one.f1.f2 0 + pack [frame .one.g -bg orange -width 80 -height 80] -anchor se -side bottom -in .one.f1.f2 + wm deiconify .one + tkwait visibility .one.g + event generate .one <Motion> -warp 1 -x 250 -y 250 + _pause 200; # needed for Windows + set result "|" +} -body { + bind all <Leave> {append result "<Leave> %d %W|"} + bind all <Enter> {append result "<Enter> %d %W|"} + destroy .one.g + update + set result +} -cleanup { + bind all <Leave> {} + bind all <Enter> {} + destroy .one + unset result +} -result {|<Enter> NotifyNonlinearVirtual .one.f1|<Enter> NotifyNonlinear .one.f1.f2|} + +test event-9.13 {pointer window is a toplevel, toplevel destination} -setup { + setup_win_mousepointer .one + toplevel .two + wm geometry .two 300x300+150+150 + wm withdraw .two + wm deiconify .two + waitForWindowEvent .two <Enter> + update idletasks; # finish displaying windows + set result | +} -body { + bind all <Leave> {append result "<Leave> %d %W|"} + bind all <Enter> {append result "<Enter> %d %W|"} + destroy .two + waitForWindowEvent .one <Enter> + update + set result +} -cleanup { + bind all <Leave> {} + bind all <Enter> {} + destroy .one + unset result +} -result {|<Enter> NotifyNonlinear .one|} + +test event-9.14 {pointer window is a toplevel, tk internal destination} -setup { + setup_win_mousepointer .one + wm withdraw .one + create_and_pack_frames .one + toplevel .two + wm geometry .two 300x300+150+150 + wm withdraw .two + wm deiconify .one + wm deiconify .two + waitForWindowEvent .two <Enter> + set result "|" +} -body { + bind all <Leave> {append result "<Leave> %d %W|"} + bind all <Enter> {append result "<Enter> %d %W|"} + destroy .two + waitForWindowEvent .one.f1.f2 <Enter> + set result +} -cleanup { + bind all <Leave> {} + bind all <Enter> {} + destroy .one + unset result +} -result {|<Enter> NotifyNonlinearVirtual .one|<Enter> NotifyNonlinearVirtual .one.f1|<Enter> NotifyNonlinear .one.f1.f2|} + +test event-9.15 {pointer window is a toplevel, destination is screen root} -setup { + setup_win_mousepointer .one; # ensure the mouse pointer is where we want it to be (the .one toplevel is not itself used in this test) +# destroy .one + toplevel .two + wm geometry .two 300x300+150+150 + wm deiconify .two + waitForWindowEvent .two <Enter> + update idletasks; # finish displaying .two + event generate .two <Motion> -warp 1 -x 275 -y 275 + controlPointerWarpTiming + set result "|" +} -body { + bind all <Leave> {append result "<Leave> %d %W|"} + bind all <Enter> {append result "<Enter> %d %W|"} + destroy .two + set result +} -cleanup { + bind all <Leave> {} + bind all <Enter> {} + destroy .one + unset result +} -result {|} + +test event-9.16 {Successive destructions (pointer window + parent), single generation of crossing events} -setup { + # Tests correctness of overwriting the dead window struct in + # TkPointerDeadWindow() and subsequent reading in GenerateEnterLeave(). + setup_win_mousepointer .one + wm withdraw .one + create_and_pack_frames .one + wm deiconify .one + tkwait visibility .one.f1.f2 + update idletasks; # finish displaying window + _pause 200; # needed for Windows + set result "|" +} -body { + bind all <Leave> {append result "<Leave> %d %W|"} + bind all <Enter> {append result "<Enter> %d %W|"} + destroy .one.f1 + update + set result +} -cleanup { + bind all <Leave> {} + bind all <Enter> {} + destroy .one + unset result +} -result {|<Enter> NotifyInferior .one|} + +test event-9.17 {Successive destructions (pointer window + parent), separate crossing events} -setup { + # Tests correctness of overwriting the dead window struct in + # TkPointerDeadWindow() and subsequent reading in GenerateEnterLeave(). + setup_win_mousepointer .one + wm withdraw .one + create_and_pack_frames .one + wm deiconify .one + tkwait visibility .one.f1.f2 + update idletasks; # finish displaying window + _pause 200; # needed for Windows + set result "|" +} -body { + bind all <Leave> {append result "<Leave> %d %W|"} + bind all <Enter> {append result "<Enter> %d %W|"} + destroy .one.f1.f2 + update; # make sure window is gone + destroy .one.f1 + update; # make sure window is gone + set result +} -cleanup { + bind all <Leave> {} + bind all <Enter> {} + destroy .one + unset result +} -result {|<Enter> NotifyInferior .one.f1|<Enter> NotifyInferior .one|} + +test event-9.18 {Successive destructions (pointer window + ancestors including its toplevel), destination is non-root toplevel} -setup { + setup_win_mousepointer .one + toplevel .two + pack propagate .two 0 + wm geometry .two 300x300+100+100 + create_and_pack_frames .two + wm deiconify .two + waitForWindowEvent .two.f1.f2 <Enter> + set result "|" +} -body { + bind all <Leave> {append result "<Leave> %d %W|"} + bind all <Enter> {append result "<Enter> %d %W|"} + destroy .two + waitForWindowEvent .one <Enter> + set result +} -cleanup { + bind all <Leave> {} + bind all <Enter> {} + destroy .one + unset result +} -result {|<Enter> NotifyNonlinear .one|} + +test event-9.19 {Successive destructions (pointer window + ancestors including its toplevel), destination is internal window, bypass root win} -setup { + setup_win_mousepointer .one; # ensure the mouse pointer is where we want it to be (the .one toplevel is not itself used in this test) +# destroy .one + toplevel .two + pack propagate .two 0 + wm geometry .two 300x300+100+100 + create_and_pack_frames .two + wm deiconify .two + toplevel .three + pack propagate .three 0 + wm geometry .three 300x300+110+110 + create_and_pack_frames .three + wm deiconify .three + waitForWindowEvent .three.f1.f2 <Enter> + update idletasks; # finish displaying windows + set result "|" +} -body { + bind all <Leave> {append result "<Leave> %d %W|"} + bind all <Enter> {append result "<Enter> %d %W|"} + destroy .three + waitForWindowEvent .two.f1.f2 <Enter> + update idletasks; #finish destroying .two + set result +} -cleanup { + bind all <Leave> {} + bind all <Enter> {} + destroy .one + destroy .two + unset result +} -result {|<Enter> NotifyNonlinearVirtual .two|<Enter> NotifyNonlinearVirtual .two.f1|<Enter> NotifyNonlinear .two.f1.f2|} + +test event-9.20 {Successive destructions (pointer window + ancestors including its toplevel), destination is screen root} -setup { + setup_win_mousepointer .one; # ensure the mouse pointer is where we want it to be (the .one toplevel is not itself used in this test) + destroy .one + toplevel .two + pack propagate .two 0 + wm geometry .two 300x300+100+100 + create_and_pack_frames .two + wm deiconify .two + waitForWindowEvent .two.f1.f2 <Enter> + set result "|" +} -body { + bind all <Leave> {append result "<Leave> %d %W|"} + bind all <Enter> {append result "<Enter> %d %W|"} + destroy .two + update idletasks; #finish destroying .two + set result +} -cleanup { + bind all <Leave> {} + bind all <Enter> {} + unset result +} -result {|} + # cleanup +# macOS sometimes has trouble deleting the test window, +# causing a failure in focus.test. +_pause 200; +deleteWindows update unset -nocomplain keypress_lookup rename _init_keypress_lookup {} @@ -883,6 +1196,8 @@ rename _keypress {} rename _pause {} rename _text_ind_to_x_y {} rename _get_selection {} +rename create_and_pack_frames {} +rename setup_win_mousepointer {} cleanupTests return diff --git a/tests/filebox.test b/tests/filebox.test index f46c906..2a02fbe 100644 --- a/tests/filebox.test +++ b/tests/filebox.test @@ -168,27 +168,27 @@ foreach mode $modes { regsub \"-foo\" $options "" options foreach option $options { - if {[string index $option 0] eq "-"} { + if {[string index $option 0] eq "-"} { test filebox-1.2-$mode$option "tk_getOpenFile command" -body { tk_getOpenFile $option } -returnCodes error -result "value for \"$option\" missing" - } + } } test filebox-1.3.1-$mode "tk_getOpenFile command" -constraints notAqua -body { - tk_getOpenFile -foo bar + tk_getOpenFile -foo bar } -returnCodes error -result $unknownOptionsMsg(tk_getOpenFile,notAqua) test filebox-1.3.2-$mode "tk_getOpenFile command" -constraints aqua -body { - tk_getOpenFile -foo bar + tk_getOpenFile -foo bar } -returnCodes error -result $unknownOptionsMsg(tk_getOpenFile,aqua) test filebox-1.4-$mode "tk_getOpenFile command" -body { - tk_getOpenFile -initialdir + tk_getOpenFile -initialdir } -returnCodes error -result {value for "-initialdir" missing} test filebox-1.5-$mode "tk_getOpenFile command" -body { - tk_getOpenFile -parent foo.bar + tk_getOpenFile -parent foo.bar } -returnCodes error -result {bad window path name "foo.bar"} test filebox-1.6-$mode "tk_getOpenFile command" -body { - tk_getOpenFile -filetypes {Foo} + tk_getOpenFile -filetypes {Foo} } -returnCodes error -result {bad file type "Foo", should be "typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?"} set isNative [expr { @@ -210,8 +210,8 @@ foreach mode $modes { # set verylongstring $verylongstring$verylongstring test filebox-2.1-$mode "tk_getOpenFile command" nonUnixUserInteraction { - ToPressButton $parent cancel - tk_getOpenFile -title "Press Cancel ($verylongstring)" -parent $parent + ToPressButton $parent cancel + tk_getOpenFile -title "Press Cancel ($verylongstring)" -parent $parent } "" set fileName $tmpFile @@ -219,63 +219,63 @@ foreach mode $modes { set pathName [file join $fileDir $fileName] test filebox-2.2-$mode "tk_getOpenFile command" nonUnixUserInteraction { - ToPressButton $parent ok - set choice [tk_getOpenFile -title "Press Ok" \ + ToPressButton $parent ok + set choice [tk_getOpenFile -title "Press Ok" \ -parent $parent -initialfile $fileName -initialdir $fileDir] } $pathName test filebox-2.3-$mode "tk_getOpenFile command" nonUnixUserInteraction { - ToEnterFileByKey $parent $fileName $fileDir - set choice [tk_getOpenFile -title "Enter \"$fileName\" and press Ok" \ + ToEnterFileByKey $parent $fileName $fileDir + set choice [tk_getOpenFile -title "Enter \"$fileName\" and press Ok" \ -parent $parent -initialdir $fileDir] } $pathName test filebox-2.4-$mode "tk_getOpenFile command" nonUnixUserInteraction { - cd $fileDir - ToPressButton $parent ok - set choice [tk_getOpenFile -title "Enter \"$fileName\" and press Ok" \ + cd $fileDir + ToPressButton $parent ok + set choice [tk_getOpenFile -title "Enter \"$fileName\" and press Ok" \ -parent $parent -initialdir . -initialfile $fileName] } $pathName test filebox-2.5-$mode "tk_getOpenFile command" nonUnixUserInteraction { - ToPressButton $parent ok - set choice [tk_getOpenFile -title "Enter \"$fileName\" and press Ok" \ + ToPressButton $parent ok + set choice [tk_getOpenFile -title "Enter \"$fileName\" and press Ok" \ -parent $parent -initialdir /badpath -initialfile $fileName] } $pathName test filebox-2.6-$mode "tk_getOpenFile command" -setup { - toplevel .t1; toplevel .t2 - wm geometry .t1 +0+0 - wm geometry .t2 +0+0 + toplevel .t1; toplevel .t2 + wm geometry .t1 +0+0 + wm geometry .t2 +0+0 } -constraints nonUnixUserInteraction -body { - set choice {} - ToPressButton .t1 ok - lappend choice [tk_getOpenFile \ + set choice {} + ToPressButton .t1 ok + lappend choice [tk_getOpenFile \ -title "Enter \"$fileName\" and press Ok" \ -parent .t1 -initialdir $fileDir \ -initialfile $fileName] - ToPressButton .t2 ok - lappend choice [tk_getOpenFile \ + ToPressButton .t2 ok + lappend choice [tk_getOpenFile \ -title "Enter \"$fileName\" and press Ok" \ -parent .t2 -initialdir $fileDir \ -initialfile $fileName] - ToPressButton .t1 ok - lappend choice [tk_getOpenFile \ + ToPressButton .t1 ok + lappend choice [tk_getOpenFile \ -title "Enter \"$fileName\" and press Ok" \ -parent .t1 -initialdir $fileDir \ -initialfile $fileName] } -result [list $pathName $pathName $pathName] -cleanup { - destroy .t1 - destroy .t2 + destroy .t1 + destroy .t2 } foreach x [lsort -integer [array names filters]] { - test filebox-3.$x-$mode "tk_getOpenFile command" nonUnixUserInteraction { + test filebox-3.$x-$mode "tk_getOpenFile command" nonUnixUserInteraction { ToPressButton $parent ok set choice [tk_getOpenFile -title "Press Ok" \ -filetypes $filters($x) -parent $parent \ -initialfile $fileName -initialdir $fileDir] - } $pathName + } $pathName } foreach {x res} [list 1 "-unset-" 2 "Text files"] { set t [expr {$x + [llength [array names filters]]}] - test filebox-3.$t-$mode "tk_getOpenFile command" nonUnixUserInteraction { + test filebox-3.$t-$mode "tk_getOpenFile command" nonUnixUserInteraction { catch {unset tv} catch {unset typeName} ToPressButton $parent ok @@ -289,7 +289,7 @@ foreach mode $modes { set typeName "-unset-" } set typeName - } $res + } $res } test filebox-4.1.1-$mode "tk_getSaveFile command" -constraints notAqua -body { diff --git a/tests/focus.test b/tests/focus.test index 03563bc..e1cfe58 100644 --- a/tests/focus.test +++ b/tests/focus.test @@ -19,8 +19,8 @@ proc focusSetup {} { toplevel .t wm geom .t +0+0 foreach i {b1 b2 b3 b4} { - button .t.$i -text .t.$i -relief raised -bd 2 - pack .t.$i + button .t.$i -text .t.$i -relief raised -bd 2 + pack .t.$i } tkwait visibility .t.b4 } @@ -43,10 +43,8 @@ proc focusSetupAlt {} { # the X server and possibly also the window manager. proc focusClear {} { - global x; - after 200 {set x 1} - tkwait variable x - dobg {focus -force .; update} + dobg {after 200; focus -force .; update} + after 400 update } @@ -82,7 +80,7 @@ test focus-1.1 {Tk_FocusCmd procedure} -constraints unix -body { focus } -result {} test focus-1.2 {Tk_FocusCmd procedure} -constraints { - unix altDisplay + unix altDisplay } -body { focus .alt.b focus @@ -108,7 +106,7 @@ test focus-1.7 {Tk_FocusCmd procedure} -constraints unix -body { focus .gorp a } -returnCodes error -result {bad option ".gorp": must be -displayof, -force, or -lastfor} test focus-1.8 {Tk_FocusCmd procedure, focussing on dead window} -constraints { - unix + unix } -setup { destroy .t2 } -body { @@ -134,36 +132,36 @@ test focus-1.8 {Tk_FocusCmd procedure, focussing on dead window} -constraints { destroy .t2 } -result {.t2.f2 .t2 .t2} test focus-1.9 {Tk_FocusCmd procedure, -displayof option} -constraints { - unix + unix } -body { focus -displayof } -returnCodes error -result {wrong # args: should be "focus -displayof window"} test focus-1.10 {Tk_FocusCmd procedure, -displayof option} -constraints { - unix + unix } -body { focus -displayof a b } -returnCodes error -result {wrong # args: should be "focus -displayof window"} test focus-1.11 {Tk_FocusCmd procedure, -displayof option} -constraints { - unix + unix } -body { focus -displayof .lousy } -returnCodes error -result {bad window path name ".lousy"} test focus-1.12 {Tk_FocusCmd procedure, -displayof option} -constraints { - unix + unix } -body { focusClear focus .t focus -displayof .t.b3 } -result {} test focus-1.13 {Tk_FocusCmd procedure, -displayof option} -constraints { - unix + unix } -body { focusClear focus -force .t focus -displayof .t.b3 } -result {.t} test focus-1.14 {Tk_FocusCmd procedure, -displayof option} -constraints { - unix altDisplay + unix altDisplay } -body { focusClear focus -force .alt.c @@ -227,7 +225,7 @@ test focus-1.25 {Tk_FocusCmd procedure} -constraints unix -body { focusSetup test focus-2.1 {TkFocusFilterEvent procedure} -constraints { - unix nonPortable testwrapper + unix nonPortable testwrapper } -body { focusClear focus -force .b @@ -239,7 +237,7 @@ test focus-2.1 {TkFocusFilterEvent procedure} -constraints { return $focusInfo } -result {} test focus-2.2 {TkFocusFilterEvent procedure} -constraints { - unix nonPortable testwrapper + unix nonPortable testwrapper } -body { focusClear focus -force .b @@ -251,7 +249,7 @@ test focus-2.2 {TkFocusFilterEvent procedure} -constraints { } -result {{in .t NotifyAncestor } .b} test focus-2.3 {TkFocusFilterEvent procedure} -constraints { - unix nonPortable testwrapper + unix nonPortable testwrapper } -body { focusClear focus -force .b @@ -330,10 +328,10 @@ test focus-2.7 {TkFocusFilterEvent procedure, FocusOut events} -constraints { foreach detail {NotifyAncestor NotifyInferior NotifyNonlinear NotifyNonlinearVirtual NotifyPointer NotifyPointerRoot NotifyVirtual} { - focus -force .t.b1 - event gen [testwrapper .t] <FocusOut> -detail $detail - update - lappend result [focus] + focus -force .t.b1 + event gen [testwrapper .t] <FocusOut> -detail $detail + update + lappend result [focus] } return $result } -result {{} .t.b1 {} {} .t.b1 .t.b1 {}} @@ -358,12 +356,12 @@ test focus-2.10 {TkFocusFilterEvent procedure, Enter events} -constraints { focus .t.b1 focusClear foreach detail {NotifyAncestor NotifyInferior NotifyNonlinear - NotifyNonlinearVirtual NotifyVirtual} { - event gen [testwrapper .t] <Enter> -detail $detail -focus 1 - update - lappend result [focus] - event gen [testwrapper .t] <Leave> -detail NotifyAncestor - update + NotifyNonlinearVirtual NotifyVirtual} { + event gen [testwrapper .t] <Enter> -detail $detail -focus 1 + update + lappend result [focus] + event gen [testwrapper .t] <Leave> -detail NotifyAncestor + update } return $result } -result {.t.b1 {} .t.b1 .t.b1 .t.b1} @@ -399,7 +397,7 @@ test focus-2.13 {TkFocusFilterEvent procedure, Enter events} -constraints { in .t.b1 NotifyAncestor } test focus-2.14 {TkFocusFilterEvent procedure, Enter events, ignore errors when setting focus due to implicit focus} -constraints { - unix testwrapper + unix testwrapper } -setup { destroy .t2 set focusInfo {} @@ -420,12 +418,12 @@ test focus-2.15 {TkFocusFilterEvent procedure, Leave events} -constraints { focus .t.b1 foreach detail {NotifyAncestor NotifyInferior NotifyNonlinear NotifyNonlinearVirtual NotifyVirtual} { - focusClear - event gen [testwrapper .t] <Enter> -detail NotifyAncestor -focus 1 - update - event gen [testwrapper .t] <Leave> -detail $detail - update - lappend result [focus] + focusClear + event gen [testwrapper .t] <Enter> -detail NotifyAncestor -focus 1 + update + event gen [testwrapper .t] <Leave> -detail $detail + update + lappend result [focus] } return $result } -result {{} .t.b1 {} {} {}} @@ -476,7 +474,7 @@ test focus-3.1 {SetFocus procedure, create record on focus} -constraints { # error if Tk forgets to make the window exist before focussing # on it. test focus-3.2 {SetFocus procedure, making window exist} -constraints { - unix testwrapper + unix testwrapper } -body { update button .b2 -text "Another button" @@ -512,7 +510,7 @@ test focus-3.4 {SetFocus procedure, delaying claim of X focus} -constraints { destroy .t2 } -result {} test focus-3.5 {SetFocus procedure, generating events} -constraints { - unix testwrapper + unix testwrapper } -body { focusSetup focusClear @@ -524,7 +522,7 @@ test focus-3.5 {SetFocus procedure, generating events} -constraints { in .t.b2 NotifyAncestor } test focus-3.6 {SetFocus procedure, generating events} -constraints { - unix testwrapper + unix testwrapper } -body { focusSetup focus -force .b @@ -552,7 +550,7 @@ unix nonPortable testwrapper test focus-4.1 {TkFocusDeadWindow procedure} -constraints { - unix testwrapper + unix testwrapper } -body { focusSetup update @@ -562,7 +560,7 @@ test focus-4.1 {TkFocusDeadWindow procedure} -constraints { focus } -result {.b} test focus-4.2 {TkFocusDeadWindow procedure} -constraints { - unix testwrapper + unix testwrapper } -body { focusSetup update @@ -576,7 +574,7 @@ test focus-4.2 {TkFocusDeadWindow procedure} -constraints { # Non-portable due to wm-specific redirection of input focus when # windows are deleted: test focus-4.3 {TkFocusDeadWindow procedure} -constraints { - unix nonPortable testwrapper + unix nonPortable testwrapper } -body { focusSetup update @@ -587,7 +585,7 @@ test focus-4.3 {TkFocusDeadWindow procedure} -constraints { focus } -result {} test focus-4.4 {TkFocusDeadWindow procedure} -constraints { - unix testwrapper + unix testwrapper } -body { focusSetup focus -force .t.b2 @@ -643,11 +641,11 @@ test focus-6.1 {miscellaneous - embedded application in same process} -constrain child eval "set argv {-use [winfo id .t.f1]}" load {} Tk child child eval { - entry .e1 -bg lightBlue - pack .e1 - bind all <FocusIn> {lappend x "focus in %W %d"} - bind all <FocusOut> {lappend x "focus out %W %d"} - set x {} + entry .e1 -bg lightBlue + pack .e1 + bind all <FocusIn> {lappend x "focus in %W %d"} + bind all <FocusOut> {lappend x "focus out %W %d"} + set x {} } # Claim the focus and wait long enough for it to really arrive. @@ -696,11 +694,11 @@ test focus-6.2 {miscellaneous - embedded application in different process} -cons bind all <FocusOut> {lappend x "focus out %W %d"} setupbg -use [winfo id .t.f1] dobg { - entry .e1 -bg lightBlue - pack .e1 - bind all <FocusIn> {lappend x "focus in %W %d"} - bind all <FocusOut> {lappend x "focus out %W %d"} - set x {} + entry .e1 -bg lightBlue + pack .e1 + bind all <FocusIn> {lappend x "focus in %W %d"} + bind all <FocusOut> {lappend x "focus out %W %d"} + set x {} } # Claim the focus and wait long enough for it to really arrive. diff --git a/tests/focusTcl.test b/tests/focusTcl.test index 6cfc230..de3b564 100644 --- a/tests/focusTcl.test +++ b/tests/focusTcl.test @@ -18,33 +18,33 @@ option add *highlightThickness 2 proc setup1 w { if {$w == "."} { - set w "" + set w "" } foreach i {a b c d} { - destroy $w.$i - frame $w.$i -width 200 -height 50 -bd 2 -relief raised - pack $w.$i + destroy $w.$i + frame $w.$i -width 200 -height 50 -bd 2 -relief raised + pack $w.$i } .b configure -width 0 -height 0 foreach i {x y z} { - destroy $w.b.$i - button $w.b.$i -text "Button $w.b.$i" - pack $w.b.$i -side left + destroy $w.b.$i + button $w.b.$i -text "Button $w.b.$i" + pack $w.b.$i -side left } if {![winfo ismapped $w.b.z]} { - tkwait visibility $w.b.z + tkwait visibility $w.b.z } } proc cleanup1 w { if {$w == "."} { - set w "" + set w "" } foreach i {a b c d} { - destroy $w.$i + destroy $w.$i } foreach i {x y z} { - destroy $w.b.$i + destroy $w.b.$i } } @@ -105,7 +105,7 @@ test focusTcl-1.9 {tk_focusNext procedure, basic tree traversal} -body { test focusTcl-1.10 {tk_focusNext procedure, basic tree traversal} -body { setup1 . foreach w {.b .b.x .b.y .c .d} { - $w configure -takefocus 0 + $w configure -takefocus 0 } tk_focusNext .a } -cleanup { @@ -114,7 +114,7 @@ test focusTcl-1.10 {tk_focusNext procedure, basic tree traversal} -body { test focusTcl-1.11 {tk_focusNext procedure, basic tree traversal} -body { setup1 . foreach w {.b .b.x .b.y .c .d} { - $w configure -takefocus 0 + $w configure -takefocus 0 } tk_focusNext .b.z } -cleanup { @@ -373,9 +373,9 @@ test focusTcl-5.2 {tkFocusOK procedure, -takefocus 1} -body { test focusTcl-5.3 {tkFocusOK procedure, -takefocus procedure} -body { proc t w { if {$w == ".b.x"} { - return 1 + return 1 } elseif {$w == ".b.y"} { - return "" + return "" } return 0 } @@ -385,7 +385,7 @@ test focusTcl-5.3 {tkFocusOK procedure, -takefocus procedure} -body { update .b configure -takefocus "" foreach w {.b.x .b.y .b.z .c} { - $w configure -takefocus t + $w configure -takefocus t } list [tk_focusNext .a] [tk_focusNext .b.x] } -cleanup { @@ -411,7 +411,7 @@ test focusTcl-5.5 {tkFocusOK procedure, -takefocus "", not mapped} -body { test focusTcl-5.6 {tkFocusOK procedure, -takefocus "", not mapped} -body { setup1 . foreach w {.b.x .b.y .b.z} { - $w configure -takefocus "" + $w configure -takefocus "" } pack forget .b update @@ -441,7 +441,7 @@ test focusTcl-5.8 {tkFocusOK procedure, -takefocus "", not mapped} -body { test focusTcl-5.9 {tkFocusOK procedure, -takefocus "", window disabled} -body { setup1 . foreach w {.b.x .b.y .b.z} { - $w configure -takefocus "" + $w configure -takefocus "" } update .b.x configure -state disabled @@ -452,7 +452,7 @@ test focusTcl-5.9 {tkFocusOK procedure, -takefocus "", window disabled} -body { test focusTcl-5.10 {tkFocusOK procedure, -takefocus "", check for bindings} -body { setup1 . foreach w {.a .b .c .d} { - $w configure -takefocus "" + $w configure -takefocus "" } update bind .a <Key> {foo} @@ -463,7 +463,7 @@ test focusTcl-5.10 {tkFocusOK procedure, -takefocus "", check for bindings} -bod test focusTcl-5.11 {tkFocusOK procedure, -takefocus "", check for bindings} -body { setup1 . foreach w {.a .b .c .d} { - $w configure -takefocus "" + $w configure -takefocus "" } update bind Frame <Key> {foo} diff --git a/tests/font.test b/tests/font.test index ca38269..13001c1 100644 --- a/tests/font.test +++ b/tests/font.test @@ -22,16 +22,16 @@ proc getnondefaultfonts {} { global defaultfontlist set nondeffonts [list ] foreach afont [font names] { - if {$afont ni $defaultfontlist} { - lappend nondeffonts $afont - } + if {$afont ni $defaultfontlist} { + lappend nondeffonts $afont + } } set nondeffonts } proc clearnondefaultfonts {} { foreach afont [getnondefaultfonts] { - font delete $afont + font delete $afont } } @@ -42,7 +42,7 @@ wm geom .t +0+0 update idletasks switch [tk windowingsystem] { - x11 {set fixed "TkFixedFont"} + x11 {set fixed "TkFixedFont"} win32 {set fixed "courier 12"} aqua {set fixed "monaco 9"} } @@ -97,7 +97,7 @@ test font-2.1 {TkFontPkgFree} -setup { lappend x [foo eval {catch {font families} msg; set msg}] } -cleanup { interp delete foo -} -result {{named font "wiggles" doesn't exist} {can't invoke "font" command: application has been destroyed}} +} -result {{named font "wiggles" does not exist} {cannot invoke "font" command: application has been destroyed}} test font-3.1 {font command: general} -body { @@ -133,7 +133,7 @@ test font-4.6 {font command: actual: arguments} -body { test font-4.7 {font command: actual: arguments} -constraints noExceed -body { # (tkfont == NULL) font actual "\{xyz" -} -returnCodes error -result "font \"{xyz\" doesn't exist" +} -returnCodes error -result "font \"{xyz\" does not exist" test font-4.8 {font command: actual: all attributes} -body { # not (objc > 3) so objPtr = NULL lindex [font actual {-family times}] 0 @@ -173,7 +173,7 @@ test font-5.1 {font command: configure} -body { test font-5.2 {font command: configure: non-existent font} -body { # (namedHashPtr == NULL) font configure xyz -} -returnCodes error -result {named font "xyz" doesn't exist} +} -returnCodes error -result {named font "xyz" does not exist} test font-5.3 {font command: configure: "deleted" font} -setup { destroy .t.f catch {font delete xyz} @@ -187,7 +187,7 @@ test font-5.3 {font command: configure: "deleted" font} -setup { font configure xyz } -cleanup { destroy .t.f -} -returnCodes error -result {named font "xyz" doesn't exist} +} -returnCodes error -result {named font "xyz" does not exist} test font-5.4 {font command: configure: get all options} -setup { catch {font delete xyz} } -body { @@ -330,7 +330,7 @@ test font-7.4 {font command: delete: non-existent} -setup { } -body { # (namedHashPtr == NULL) font delete xyz -} -returnCodes error -result {named font "xyz" doesn't exist} +} -returnCodes error -result {named font "xyz" does not exist} test font-7.5 {font command: delete: mark for later deletion} -setup { destroy .t.f catch {font delete xyz} @@ -345,7 +345,7 @@ test font-7.5 {font command: delete: mark for later deletion} -setup { font configure xyz } -cleanup { destroy .t.f -} -returnCodes error -result {named font "xyz" doesn't exist} +} -returnCodes error -result {named font "xyz" does not exist} test font-7.6 {font command: delete: mark for later deletion} -setup { destroy .t.f catch {font delete xyz} @@ -405,7 +405,7 @@ test font-9.3 {font command: measure: arguments} -body { test font-9.4 {font command: measure: arguments} -constraints noExceed -body { # (tkfont == NULL) font measure "\{xyz" abc -} -returnCodes error -result "font \"{xyz\" doesn't exist" +} -returnCodes error -result "font \"{xyz\" does not exist" test font-9.5 {font command: measure} -body { # Tk_TextWidth() expr {[font measure $fixed "abcdefg"] == [font measure $fixed "a"]*7 } @@ -443,7 +443,7 @@ test font-10.5 {font command: metrics: arguments} -body { test font-10.6 {font command: metrics: bad font} -constraints noExceed -body { # (tkfont == NULL) font metrics "\{xyz" -} -returnCodes error -result "font \"{xyz\" doesn't exist" +} -returnCodes error -result "font \"{xyz\" does not exist" test font-10.7 {font command: metrics: get all metrics} -setup { catch {unset a} } -body { @@ -707,7 +707,7 @@ test font-15.9 {Tk_AllocFontFromObj procedure: get attribute font} -setup { test font-15.10 {Tk_AllocFontFromObj procedure: no match} -constraints noExceed -body { # (ParseFontNameObj() != TCL_OK) font actual "\{xyz" -} -returnCodes error -result "font \"{xyz\" doesn't exist" +} -returnCodes error -result "font \"{xyz\" does not exist" test font-15.11 {Tk_AllocFontFromObj procedure: get attribute font} -body { # not (ParseFontNameObj() != TCL_OK) lindex [font actual {plan 9}] 0 @@ -946,9 +946,9 @@ test font-21.7 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {avantgarde 12 roman normal} if {[font actual {avantgarde 12 roman normal} -family] == "avantgarde"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x AvantGarde-Book + set x AvantGarde-Book } } -result {AvantGarde-Book} test font-21.8 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -956,9 +956,9 @@ test font-21.8 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {avantgarde 12 roman bold} if {[font actual {avantgarde 12 roman normal} -family] == "avantgarde"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x AvantGarde-Demi + set x AvantGarde-Demi } } -result {AvantGarde-Demi} test font-21.9 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -966,9 +966,9 @@ test font-21.9 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {avantgarde 12 italic normal} if {[font actual {avantgarde 12 roman normal} -family] == "avantgarde"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x AvantGarde-BookOblique + set x AvantGarde-BookOblique } } -result {AvantGarde-BookOblique} test font-21.10 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -976,9 +976,9 @@ test font-21.10 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {avantgarde 12 italic bold} if {[font actual {avantgarde 12 roman normal} -family] == "avantgarde"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x AvantGarde-DemiOblique + set x AvantGarde-DemiOblique } } -result {AvantGarde-DemiOblique} @@ -987,9 +987,9 @@ test font-21.11 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {bookman 12 roman normal} if {[font actual {avantgarde 12 roman normal} -family] == "bookman"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Bookman-Light + set x Bookman-Light } } -result {Bookman-Light} test font-21.12 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -997,9 +997,9 @@ test font-21.12 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {bookman 12 roman bold} if {[font actual {avantgarde 12 roman normal} -family] == "bookman"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Bookman-Demi + set x Bookman-Demi } } -result {Bookman-Demi} test font-21.13 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1007,9 +1007,9 @@ test font-21.13 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {bookman 12 italic normal} if {[font actual {avantgarde 12 roman normal} -family] == "bookman"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Bookman-LightItalic + set x Bookman-LightItalic } } -result {Bookman-LightItalic} test font-21.14 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1017,9 +1017,9 @@ test font-21.14 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {bookman 12 italic bold} if {[font actual {avantgarde 12 roman normal} -family] == "bookman"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Bookman-DemiItalic + set x Bookman-DemiItalic } } -result {Bookman-DemiItalic} @@ -1028,9 +1028,9 @@ test font-21.15 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {courier 12 roman normal} if {[font actual {avantgarde 12 roman normal} -family] == "courier"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Courier + set x Courier } } -result {Courier} test font-21.16 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1038,9 +1038,9 @@ test font-21.16 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {courier 12 roman bold} if {[font actual {avantgarde 12 roman normal} -family] == "courier"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Courier-Bold + set x Courier-Bold } } -result {Courier-Bold} test font-21.17 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1048,9 +1048,9 @@ test font-21.17 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {courier 12 italic normal} if {[font actual {avantgarde 12 roman normal} -family] == "courier"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Courier-Oblique + set x Courier-Oblique } } -result {Courier-Oblique} test font-21.18 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1058,9 +1058,9 @@ test font-21.18 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {courier 12 italic bold} if {[font actual {avantgarde 12 roman normal} -family] == "courier"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Courier-BoldOblique + set x Courier-BoldOblique } } -result {Courier-BoldOblique} @@ -1069,9 +1069,9 @@ test font-21.19 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {helvetica 12 roman normal} if {[font actual {avantgarde 12 roman normal} -family] == "helvetica"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Helvetica + set x Helvetica } } -result {Helvetica} test font-21.20 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1079,9 +1079,9 @@ test font-21.20 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {helvetica 12 roman bold} if {[font actual {avantgarde 12 roman normal} -family] == "helvetica"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Helvetica-Bold + set x Helvetica-Bold } } -result {Helvetica-Bold} test font-21.21 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1089,9 +1089,9 @@ test font-21.21 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {helvetica 12 italic normal} if {[font actual {avantgarde 12 roman normal} -family] == "helvetica"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Helvetica-Oblique + set x Helvetica-Oblique } } -result {Helvetica-Oblique} test font-21.22 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1099,9 +1099,9 @@ test font-21.22 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {helvetica 12 italic bold} if {[font actual {avantgarde 12 roman normal} -family] == "helvetica"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Helvetica-BoldOblique + set x Helvetica-BoldOblique } } -result {Helvetica-BoldOblique} @@ -1110,9 +1110,9 @@ test font-21.23 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {{new century schoolbook} 12 roman normal} if {[font actual {avantgarde 12 roman normal} -family] == "new century schoolbook"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x NewCenturySchlbk-Roman + set x NewCenturySchlbk-Roman } } -result {NewCenturySchlbk-Roman} test font-21.24 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1120,9 +1120,9 @@ test font-21.24 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {{new century schoolbook} 12 roman bold} if {[font actual {avantgarde 12 roman normal} -family] == "new century schoolbook"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x NewCenturySchlbk-Bold + set x NewCenturySchlbk-Bold } } -result {NewCenturySchlbk-Bold} test font-21.25 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1130,9 +1130,9 @@ test font-21.25 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {{new century schoolbook} 12 italic normal} if {[font actual {avantgarde 12 roman normal} -family] == "new century schoolbook"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x NewCenturySchlbk-Italic + set x NewCenturySchlbk-Italic } } -result {NewCenturySchlbk-Italic} test font-21.26 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1140,9 +1140,9 @@ test font-21.26 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {{new century schoolbook} 12 italic bold} if {[font actual {avantgarde 12 roman normal} -family] == "new century schoolbook"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x NewCenturySchlbk-BoldItalic + set x NewCenturySchlbk-BoldItalic } } -result {NewCenturySchlbk-BoldItalic} @@ -1151,9 +1151,9 @@ test font-21.27 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {palatino 12 roman normal} if {[font actual {avantgarde 12 roman normal} -family] == "palatino"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Palatino-Roman + set x Palatino-Roman } } -result {Palatino-Roman} test font-21.28 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1161,9 +1161,9 @@ test font-21.28 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {palatino 12 roman bold} if {[font actual {avantgarde 12 roman normal} -family] == "palatino"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Palatino-Bold + set x Palatino-Bold } } -result {Palatino-Bold} test font-21.29 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1171,9 +1171,9 @@ test font-21.29 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {palatino 12 italic normal} if {[font actual {avantgarde 12 roman normal} -family] == "palatino"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Palatino-Italic + set x Palatino-Italic } } -result {Palatino-Italic} test font-21.30 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1181,9 +1181,9 @@ test font-21.30 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {palatino 12 italic bold} if {[font actual {avantgarde 12 roman normal} -family] == "palatino"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Palatino-BoldItalic + set x Palatino-BoldItalic } } -result {Palatino-BoldItalic} @@ -1192,9 +1192,9 @@ test font-21.31 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {symbol 12 roman normal} if {[font actual {avantgarde 12 roman normal} -family] == "symbol"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Symbol + set x Symbol } } -result {Symbol} test font-21.32 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1202,9 +1202,9 @@ test font-21.32 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {symbol 12 roman bold} if {[font actual {avantgarde 12 roman normal} -family] == "symbol"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Symbol + set x Symbol } } -result {Symbol} test font-21.33 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1212,9 +1212,9 @@ test font-21.33 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {symbol 12 italic normal} if {[font actual {avantgarde 12 roman normal} -family] == "symbol"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Symbol + set x Symbol } } -result {Symbol} test font-21.34 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1222,9 +1222,9 @@ test font-21.34 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {symbol 12 italic bold} if {[font actual {avantgarde 12 roman normal} -family] == "symbol"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Symbol + set x Symbol } } -result {Symbol} @@ -1233,9 +1233,9 @@ test font-21.35 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {times 12 roman normal} if {[font actual {avantgarde 12 roman normal} -family] == "times"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Times-Roman + set x Times-Roman } } -result {Times-Roman} test font-21.36 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1243,9 +1243,9 @@ test font-21.36 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {times 12 roman bold} if {[font actual {avantgarde 12 roman normal} -family] == "times"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Times-Bold + set x Times-Bold } } -result {Times-Bold} test font-21.37 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1253,9 +1253,9 @@ test font-21.37 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {times 12 italic normal} if {[font actual {avantgarde 12 roman normal} -family] == "times"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Times-Italic + set x Times-Italic } } -result {Times-Italic} test font-21.38 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1263,9 +1263,9 @@ test font-21.38 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {times 12 italic bold} if {[font actual {avantgarde 12 roman normal} -family] == "times"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x Times-BoldItalic + set x Times-BoldItalic } } -result {Times-BoldItalic} @@ -1274,9 +1274,9 @@ test font-21.39 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {zapfchancery 12 roman normal} if {[font actual {avantgarde 12 roman normal} -family] == "zapfchancery"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x ZapfChancery-MediumItalic + set x ZapfChancery-MediumItalic } } -result {ZapfChancery-MediumItalic} test font-21.40 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1284,9 +1284,9 @@ test font-21.40 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {zapfchancery 12 roman bold} if {[font actual {avantgarde 12 roman normal} -family] == "zapfchancery"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x ZapfChancery-MediumItalic + set x ZapfChancery-MediumItalic } } -result {ZapfChancery-MediumItalic} test font-21.41 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1294,9 +1294,9 @@ test font-21.41 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {zapfchancery 12 italic normal} if {[font actual {avantgarde 12 roman normal} -family] == "zapfchancery"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x ZapfChancery-MediumItalic + set x ZapfChancery-MediumItalic } } -result {ZapfChancery-MediumItalic} test font-21.42 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1304,9 +1304,9 @@ test font-21.42 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {zapfchancery 12 italic bold} if {[font actual {avantgarde 12 roman normal} -family] == "zapfchancery"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x ZapfChancery-MediumItalic + set x ZapfChancery-MediumItalic } } -result {ZapfChancery-MediumItalic} @@ -1315,9 +1315,9 @@ test font-21.43 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {zapfdingbats 12 roman normal} if {[font actual {avantgarde 12 roman normal} -family] == "zapfdingbats"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x ZapfDingbats + set x ZapfDingbats } } -result {ZapfDingbats} test font-21.44 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1325,9 +1325,9 @@ test font-21.44 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {zapfdingbats 12 roman bold} if {[font actual {avantgarde 12 roman normal} -family] == "zapfdingbats"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x ZapfDingbats + set x ZapfDingbats } } -result {ZapfDingbats} test font-21.45 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1335,9 +1335,9 @@ test font-21.45 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {zapfdingbats 12 italic normal} if {[font actual {avantgarde 12 roman normal} -family] == "zapfdingbats"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x ZapfDingbats + set x ZapfDingbats } } -result {ZapfDingbats} test font-21.46 {Tk_PostscriptFontName procedure: exhaustive} -constraints { @@ -1345,9 +1345,9 @@ test font-21.46 {Tk_PostscriptFontName procedure: exhaustive} -constraints { } -body { set name {zapfdingbats 12 italic bold} if {[font actual {avantgarde 12 roman normal} -family] == "zapfdingbats"} { - set x [psfontname avantgarde 12 roman normal] + set x [psfontname avantgarde 12 roman normal] } else { - set x ZapfDingbats + set x ZapfDingbats } } -result {ZapfDingbats} @@ -2254,10 +2254,10 @@ test font-38.6 {ParseFontNameObj procedure: begins with *} -body { } -result [font actual {times 0} -family] test font-38.7 {ParseFontNameObj procedure: arguments} -constraints noExceed -body { font actual "\{xyz" -} -returnCodes error -result "font \"{xyz\" doesn't exist" +} -returnCodes error -result "font \"{xyz\" does not exist" test font-38.8 {ParseFontNameObj procedure: arguments} -constraints noExceed -body { font actual "" -} -returnCodes error -result {font "" doesn't exist} +} -returnCodes error -result {font "" does not exist} test font-38.9 {ParseFontNameObj procedure: arguments} -body { font actual {times 20 xyz xyz} } -returnCodes error -result {unknown font style "xyz"} @@ -2305,7 +2305,7 @@ test font-40.4 {TkFontParseXLFD procedure: all fields unspecified} -body { } -result {-family} test font-40.5 {TkFontParseXLFD procedure: all fields specified} -body { lindex [font actual \ - -foundry-times-weight-slant-setwidth-addstyle-10-10-10-10-spacing-avgwidth-registry-encoding] 1 + -foundry-times-weight-slant-setwidth-addstyle-10-10-10-10-spacing-avgwidth-registry-encoding] 1 } -result [font actual {times 0} -family] @@ -2381,11 +2381,11 @@ test font-45.2 {TkFontGetAliasList: match} -constraints win -body { } -result {times} test font-45.3 {TkFontGetAliasList: match} -constraints {noExceed failsOnUbuntu} -body { if {[font actual {{times new roman} 10} -family] eq "Times New Roman"} { - # avoid test failure on systems that have a real "times new roman" font - set res 1 + # avoid test failure on systems that have a real "times new roman" font + set res 1 } else { - set res [expr {[font actual {{times new roman} 10} -family] eq \ - [font actual {times 10} -family]} ] + set res [expr {[font actual {{times new roman} 10} -family] eq \ + [font actual {times 10} -family]} ] } } -result 1 @@ -2434,15 +2434,15 @@ test font-47.2 {Bug 3049518 - Canvas} -body { set twidth [font measure MyFont $text] set theight [font metrics MyFont -linespace] set circid [$c create polygon \ - 15 15 \ - [expr {15 + $twidth}] 15 \ - [expr {15 + $twidth}] [expr {15 + $theight}] \ - 15 [expr {15 + $theight}] \ - -width 1 -joinstyle round -smooth true -fill {} -outline blue] + 15 15 \ + [expr {15 + $twidth}] 15 \ + [expr {15 + $twidth}] [expr {15 + $theight}] \ + 15 [expr {15 + $theight}] \ + -width 1 -joinstyle round -smooth true -fill {} -outline blue] pack $c -fill both -expand 1 -side top update - # Lamda test functions + # Lambda test functions set circle_text {{w user_data text circ} { if {[winfo class $w] ne "Canvas"} { puts "Wrong widget type: $w" @@ -2468,6 +2468,7 @@ test font-47.2 {Bug 3049518 - Canvas} -body { apply $circle_text $c FontChanged $textid $circid update bind $c <<TkWorldChanged>> [list apply $circle_text %W %d $textid $circid] + update idletasks # Begin test: set results {} diff --git a/tests/fontchooser.test b/tests/fontchooser.test index 4afda83..f852e97 100644 --- a/tests/fontchooser.test +++ b/tests/fontchooser.test @@ -25,21 +25,21 @@ proc then {cmd} { } proc afterbody {} { if {$::tk_dialog == {}} { - if {[incr ::iter_after] > 30} { - set ::dialogresult ">30 iterations waiting for tk_dialog" - return - } - after 150 {afterbody} - return + if {[incr ::iter_after] > 30} { + set ::dialogresult ">30 iterations waiting for tk_dialog" + return + } + after 150 {afterbody} + return } uplevel #0 {set dialogresult [eval $command]} } proc Click {button} { switch -exact -- $button { - ok { $::tk_dialog.ok invoke } - cancel { $::tk_dialog.cancel invoke } - apply { $::tk_dialog.apply invoke } - default { return -code error "invalid button name \"$button\"" } + ok { $::tk_dialog.ok invoke } + cancel { $::tk_dialog.cancel invoke } + apply { $::tk_dialog.apply invoke } + default { return -code error "invalid button name \"$button\"" } } } proc ApplyFont {font} { @@ -96,37 +96,37 @@ testConstraint scriptImpl [llength [info proc ::tk::fontchooser::Configure]] test fontchooser-2.0 {fontchooser -title} -constraints scriptImpl -body { start { - tk::fontchooser::Configure -title "Hello" - tk::fontchooser::Show + tk::fontchooser::Configure -title "Hello" + tk::fontchooser::Show } then { - set x [wm title $::tk_dialog] - Click cancel + set x [wm title $::tk_dialog] + Click cancel } set x } -result {Hello} test fontchooser-2.1 {fontchooser -title (cyrillic)} -constraints scriptImpl -body { start { - tk::fontchooser::Configure \ - -title "Привет" - tk::fontchooser::Show + tk::fontchooser::Configure \ + -title "Привет" + tk::fontchooser::Show } then { - set x [wm title $::tk_dialog] - Click cancel + set x [wm title $::tk_dialog] + Click cancel } set x } -result "Привет" test fontchooser-3.0 {fontchooser -parent} -constraints scriptImpl -body { start { - tk::fontchooser::Configure -parent . - tk::fontchooser::Show + tk::fontchooser::Configure -parent . + tk::fontchooser::Show } then { - set x [winfo parent $::tk_dialog] - Click cancel + set x [winfo parent $::tk_dialog] + Click cancel } set x } -result {.} @@ -137,55 +137,55 @@ test fontchooser-3.1 {fontchooser -parent (invalid)} -constraints scriptImpl -bo test fontchooser-4.0 {fontchooser -font} -constraints scriptImpl -body { start { - tk::fontchooser::Configure -command ApplyFont -font courier - tk::fontchooser::Show + tk::fontchooser::Configure -command ApplyFont -font courier + tk::fontchooser::Show } then { - Click cancel + Click cancel } set ::testfont } -result {} test fontchooser-4.1 {fontchooser -font} -constraints scriptImpl -body { start { - tk::fontchooser::Configure -command ApplyFont -font courier - tk::fontchooser::Show + tk::fontchooser::Configure -command ApplyFont -font courier + tk::fontchooser::Show } then { - Click ok + Click ok } expr {$::testfont ne {}} } -result 1 test fontchooser-4.2 {fontchooser -font} -constraints scriptImpl -body { start { - tk::fontchooser::Configure -command ApplyFont -font TkDefaultFont - tk::fontchooser::Show + tk::fontchooser::Configure -command ApplyFont -font TkDefaultFont + tk::fontchooser::Show } then { - Click ok + Click ok } expr {$::testfont ne {}} } -result 1 test fontchooser-4.3 {fontchooser -font} -constraints scriptImpl -body { start { - tk::fontchooser::Configure -command ApplyFont -font {times 14 bold} - tk::fontchooser::Show + tk::fontchooser::Configure -command ApplyFont -font {times 14 bold} + tk::fontchooser::Show } then { - Click ok + Click ok } expr {$::testfont ne {}} } -result 1 test fontchooser-4.4 {fontchooser -font} -constraints {scriptImpl haveTimes14BoldFont} -body { start { - tk::fontchooser::Configure -command ApplyFont -font {times 14 bold} - tk::fontchooser::Show + tk::fontchooser::Configure -command ApplyFont -font {times 14 bold} + tk::fontchooser::Show } then { - Click ok + Click ok } lrange $::testfont 1 end } -result {14 bold} diff --git a/tests/frame.test b/tests/frame.test index 74768e4..65bcb95 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -169,9 +169,9 @@ test frame-1.12 {frame configuration options} -setup { frame .f set opts {} foreach opt [.f configure] { - if {[llength $opt] == 5} { - lappend opts [lindex $opt 0] [lindex $opt 4] - } + if {[llength $opt] == 5} { + lappend opts [lindex $opt 0] [lindex $opt 4] + } } frame .g {*}$opts } -cleanup { @@ -213,7 +213,7 @@ test frame-1.19 {frame configuration options} -body { lindex [.f configure -borderwidth] 4 } -cleanup { .f configure -borderwidth [lindex [.f configure -borderwidth] 3] -} -result 1 +} -result 1.3 test frame-1.20 {frame configuration options} -body { .f configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} @@ -376,7 +376,7 @@ test frame-2.8 {toplevel configuration options} -constraints win -setup { .t configure -use 0x44022 } -cleanup { deleteWindows -} -returnCodes error -result {window "0x44022" doesn't exist} +} -returnCodes error -result {window "0x44022" does not exist} test frame-2.9 {toplevel configuration options} -constraints win -setup { deleteWindows } -body { @@ -476,9 +476,9 @@ test frame-2.19 {toplevel configuration options} -setup { # Make sure all options can be set to the default value toplevel .f foreach opt [.f configure] { - if {[llength $opt] == 5} { - lappend opts [lindex $opt 0] [lindex $opt 4] - } + if {[llength $opt] == 5} { + lappend opts [lindex $opt 0] [lindex $opt 4] + } } toplevel .g {*}$opts } -cleanup { @@ -514,7 +514,7 @@ test frame-2.25 {toplevel configuration options} -body { test frame-2.26 {toplevel configuration options} -body { .t configure -borderwidth 1.3 lindex [.t configure -borderwidth] 4 -} -result 1 +} -result 1.3 test frame-2.27 {toplevel configuration options} -body { .t configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} @@ -1097,26 +1097,26 @@ test frame-12.2 {FrameWorldChanged procedure} -setup { # Test all -labelanchor positions set font {helvetica 12} labelframe .f -highlightthickness 1 -bd 3 -padx 1 -pady 2 -font $font \ - -text "Mupp" + -text "Mupp" set fh [expr {max([font metrics $font -linespace] + 2 - 3, 0)}] set fw [expr {max([font measure $font "Mupp"] + 2 - 3, 0)}] place .f -x 0 -y 0 -width 100 -height 100 pack [frame .f.f] -fill both -expand 1 set result {} foreach lp {nw n ne en e es se s sw ws w wn} { - .f configure -labelanchor $lp - update - set expx 5 - set expy 6 - set expw 90 - set exph 88 - switch -glob $lp { - n* {incr expy $fh ; incr exph -$fh} - s* {incr exph -$fh} - w* {incr expx $fw ; incr expw -$fw} - e* {incr expw -$fw} - } - lappend result [expr { + .f configure -labelanchor $lp + update + set expx 5 + set expy 6 + set expw 90 + set exph 88 + switch -glob $lp { + n* {incr expy $fh ; incr exph -$fh} + s* {incr exph -$fh} + w* {incr expx $fw ; incr expw -$fw} + e* {incr expw -$fw} + } + lappend result [expr { [winfo x .f.f] == $expx && [winfo y .f.f] == $expy && [winfo width .f.f] == $expw && [winfo height .f.f] == $exph }] @@ -1248,7 +1248,7 @@ test frame-13.16 {labelframe configuration options} -body { lindex [.f configure -borderwidth] 4 } -cleanup { .f configure -borderwidth [lindex [.f configure -borderwidth] 3] -} -result 1 +} -result 1.3 test frame-13.17 {labelframe configuration options} -body { .f configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} @@ -1391,7 +1391,7 @@ test frame-14.1 {labelframe labelwidget option} -setup { pack .f.f update list [winfo children .] [winfo width .f] \ - [expr {[winfo height .f] - [winfo height .l]}] + [expr {[winfo height .f] - [winfo height .l]}] } -cleanup { deleteWindows } -result {{.f .l} 54 52} @@ -1509,7 +1509,7 @@ test frame-15.2 {TIP 262: frame background images} -setup { .f configure -backgroundimage gorp } -returnCodes error -cleanup { deleteWindows -} -result {image "gorp" doesn't exist} +} -result {image "gorp" does not exist} test frame-15.3 {TIP 262: frame background images} -setup { deleteWindows image create photo gorp -width 10 -height 10 @@ -1689,7 +1689,7 @@ test frame-15.9 {TIP 262: toplevel background images} -setup { .t configure -backgroundimage gorp } -returnCodes error -cleanup { deleteWindows -} -result {image "gorp" doesn't exist} +} -result {image "gorp" does not exist} test frame-15.10 {TIP 262: toplevel background images} -setup { deleteWindows image create photo gorp -width 10 -height 10 diff --git a/tests/geometry.test b/tests/geometry.test index 6576331..1588bb9 100644 --- a/tests/geometry.test +++ b/tests/geometry.test @@ -32,7 +32,7 @@ button .f.f.b4 -text .b4 test geometry-1.1 {Tk_ManageGeometry procedure} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { place .b1 -x 120 -y 80 @@ -41,7 +41,7 @@ test geometry-1.1 {Tk_ManageGeometry procedure} -setup { } -result {120 80} test geometry-1.2 {Tk_ManageGeometry procedure} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { place .f -x 20 -y 30 -width 200 -height 200 @@ -56,7 +56,7 @@ test geometry-1.2 {Tk_ManageGeometry procedure} -setup { test geometry-2.1 {Tk_GeometryRequest procedure} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } destroy .f2 } -body { @@ -65,7 +65,7 @@ test geometry-2.1 {Tk_GeometryRequest procedure} -setup { .f2 configure -width 150 -height 300 update lappend result [winfo reqwidth .f2] [winfo reqheight .f2] \ - [winfo geom .f2] + [winfo geom .f2] place .f2 -x 10 -y 20 update lappend result [winfo geom .f2] @@ -79,7 +79,7 @@ test geometry-2.1 {Tk_GeometryRequest procedure} -setup { test geometry-3.1 {Tk_SetInternalBorder procedure} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { place .f -x 20 -y 30 -width 200 -height 200 @@ -96,7 +96,7 @@ test geometry-3.1 {Tk_SetInternalBorder procedure} -setup { test geometry-4.1 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { place .f -x 20 -y 30 -width 200 -height 200 @@ -108,7 +108,7 @@ test geometry-4.1 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { } -result {91 46} test geometry-4.2 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { place .f -x 20 -y 30 -width 200 -height 200 @@ -121,11 +121,11 @@ test geometry-4.2 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { place .f -x 30 -y 25 update list [winfo x .b1] [winfo y .b1] [winfo x .b2] [winfo y .b2] \ - [winfo x .b3] [winfo y .b3] + [winfo x .b3] [winfo y .b3] } -result {101 41 61 61 101 61} test geometry-4.3 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { place .f -x 20 -y 30 -width 200 -height 200 @@ -140,11 +140,11 @@ test geometry-4.3 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { place .f.f -x 10 -y 25 update list [winfo x .b1] [winfo y .b1] [winfo x .b2] [winfo y .b2] \ - [winfo x .b3] [winfo y .b3] + [winfo x .b3] [winfo y .b3] } -result {0 0 46 86 86 86} test geometry-4.4 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { place .f -x 20 -y 30 -width 200 -height 200 @@ -159,11 +159,11 @@ test geometry-4.4 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { place .f.f.f -x 2 -y 3 update list [winfo x .b1] [winfo y .b1] [winfo x .b2] [winfo y .b2] \ - [winfo x .b3] [winfo y .b3] + [winfo x .b3] [winfo y .b3] } -result {93 49 0 0 93 69} test geometry-4.5 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { place .f -x 20 -y 30 -width 200 -height 200 @@ -178,11 +178,11 @@ test geometry-4.5 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { place .f.f.f -x 2 -y 3 update list [winfo x .b1] [winfo y .b1] [winfo x .b2] [winfo y .b2] \ - [winfo x .b3] [winfo y .b3] + [winfo x .b3] [winfo y .b3] } -result {93 49 53 69 0 0} test geometry-4.6 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { foreach w {.f .f.f .f.f.f .b1 .b2 .b3 .f.f.b4} { @@ -200,7 +200,7 @@ test geometry-4.6 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { } -result {54 9 56 71} test geometry-4.7 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { bind .b1 <Configure> {lappend x configure} @@ -223,7 +223,7 @@ test geometry-4.7 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { } -result {init configure |} test geometry-4.8 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { place .f -x 20 -y 30 -width 200 -height 200 @@ -239,12 +239,12 @@ test geometry-4.8 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { place .f -x 30 -y 25 update list [winfo x .b1] [winfo y .b1] [winfo ismapped .b1] \ - [winfo x .b2] [winfo y .b2] [winfo ismapped .b2] \ - [winfo x .b3] [winfo y .b3] [winfo ismapped .b3] + [winfo x .b2] [winfo y .b2] [winfo ismapped .b2] \ + [winfo x .b3] [winfo y .b3] [winfo ismapped .b3] } -result {91 46 0 51 66 0 91 66 0} test geometry-4.9 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } } -body { place .f -x 20 -y 30 -width 200 -height 200 @@ -262,7 +262,7 @@ test geometry-4.9 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { } -result {1 0 1} test geometry-4.10 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { foreach w {.f .f.f .f.f.f .b1 .b2 .b3} { - place forget $w + place forget $w } destroy .t } -body { diff --git a/tests/get.test b/tests/get.test index 51b6b94..ce1d372 100644 --- a/tests/get.test +++ b/tests/get.test @@ -97,7 +97,7 @@ test get-1.11 {Tk_GetAnchorFromObj - error} -setup { .b configure -anchor unknown } -cleanup { destroy .b -} -returnCodes {error} -result {bad anchor "unknown": must be n, ne, e, se, s, sw, w, nw, or center} +} -returnCodes error -result {bad anchor "unknown": must be n, ne, e, se, s, sw, w, nw, or center} test get-2.1 {Tk_GetJustifyFromObj} -setup { @@ -130,7 +130,7 @@ test get-2.4 {Tk_GetJustifyFromObj - error} -setup { .b configure -justify stupid } -cleanup { destroy .b -} -returnCodes {error} -result {bad justification "stupid": must be left, right, or center} +} -returnCodes error -result {bad justification "stupid": must be left, right, or center} # cleanup cleanupTests diff --git a/tests/grid.test b/tests/grid.test index 9aa2f84..128c244 100644 --- a/tests/grid.test +++ b/tests/grid.test @@ -709,7 +709,7 @@ test grid-10.23 {column/row configure} -body { grid columnconfigure . .b -weight 1 set res {} foreach i {0 1 2 3} { - lappend res [grid columnconfigure . $i -weight] + lappend res [grid columnconfigure . $i -weight] } return $res } -cleanup { @@ -726,7 +726,7 @@ test grid-10.24 {column/row configure} -body { grid columnconfigure . .c -weight 2 set res {} foreach i {0 1 2 3 4 5 6} { - lappend res [grid columnconfigure . $i -weight] + lappend res [grid columnconfigure . $i -weight] } return $res } -cleanup { @@ -743,7 +743,7 @@ test grid-10.25 {column/row configure} -body { grid rowconfigure . {1 .d} -weight 2 set res {} foreach i {0 1 2 3 4 5 6 7} { - lappend res [grid rowconfigure . $i -weight] + lappend res [grid rowconfigure . $i -weight] } return $res } -cleanup { @@ -1023,7 +1023,7 @@ test grid-11.15 {^ ^ test with multiple windows} -body { } -result {{0,0 50,50} {50,0 50,100} {100,0 50,100} {0,50 50,50}} test grid-11.16 {default widget placement} -body { foreach l {a b c d e} { - frame .$l -width 50 -height 50 + frame .$l -width 50 -height 50 } grid .a .b .c .d -sticky news grid x ^ x .e -sticky news @@ -1037,7 +1037,7 @@ test grid-11.16 {default widget placement} -body { } -result {50 100 50} test grid-11.17 {default widget placement} -body { foreach l {a b c d e} { - frame .$l -width 50 -height 50 + frame .$l -width 50 -height 50 } grid .a .b .c .d -sticky news grid ^ x ^ .e -sticky news @@ -1051,7 +1051,7 @@ test grid-11.17 {default widget placement} -body { } -result {100 50 100} test grid-11.18 {default widget placement} -body { foreach l {a b c d e} { - frame .$l -width 50 -height 50 + frame .$l -width 50 -height 50 } grid .a .b .c .d -sticky news grid ^ ^ ^ x -in . ;# ^ and no child should work with -in. @@ -1067,7 +1067,7 @@ test grid-11.18 {default widget placement} -body { } -result {100 100 100 50} test grid-11.19 {default widget placement} -body { foreach l {a b c d e} { - frame .$l -width 50 -height 50 + frame .$l -width 50 -height 50 } grid .a .b -sticky news grid .c .d -sticky news @@ -1143,8 +1143,8 @@ test grid-13.1 {-in} -body { test grid-13.2 {-in} -body { frame .f -bg red list [winfo manager .f] \ - [catch {grid .f -in .f} err] $err \ - [winfo manager .f] + [catch {grid .f -in .f} err] $err \ + [winfo manager .f] } -cleanup { grid_reset 13.1.1 } -result {{} 1 {window can't be managed in itself} {}} @@ -1321,11 +1321,11 @@ test grid-14.1 {structure notify} -body { update set a "" lappend a "[winfo x .g],[winfo y .g] \ - [winfo width .g],[winfo height .g]" + [winfo width .g],[winfo height .g]" .f configure -bd 5 -relief raised update lappend a "[winfo x .g],[winfo y .g] \ - [winfo width .g],[winfo height .g]" + [winfo width .g],[winfo height .g]" return $a } -cleanup { grid_reset 14.1 @@ -1565,13 +1565,13 @@ test grid-16.9 {layout uniform} -body { frame .f4 -width 135 -height 100 frame .f5 -width 80 -height 40 for {set t 1} {$t <= 5} {incr t} { - grid .f$t + grid .f$t } grid rowconfigure . {0 2} -uniform a grid rowconfigure . {1 3} -uniform b update list [grid bbox . 0 0] [grid bbox . 0 1] [grid bbox . 0 2] \ - [grid bbox . 0 3] [grid bbox . 0 4] + [grid bbox . 0 3] [grid bbox . 0 4] } -cleanup { grid_reset 16.9 } -result {{0 0 135 75} {0 75 135 100} {0 175 135 75} {0 250 135 100} {0 350 135 40}} @@ -1591,7 +1591,7 @@ test grid-16.10 {layout uniform} -body { grid columnconfigure . 4 -minsize 130 update list [grid bbox . 0 0] [grid bbox . 2 1] [grid bbox . 1 2] \ - [grid bbox . 4 3] [grid bbox . 3 4] + [grid bbox . 4 3] [grid bbox . 3 4] } -cleanup { grid_reset 16.10 } -result {{0 0 75 60} {170 60 150 30} {75 90 95 90} {390 180 140 100} {320 280 70 45}} @@ -1634,7 +1634,7 @@ test grid-16.12 {layout uniform (grow)} -body { } -cleanup { grid_reset 16.12 } -result [list {0 0 50 95} {50 0 50 95} {100 0 100 95} {200 0 70 95} \ - {0 0 70 95} {70 0 50 95} {120 0 140 95} {260 0 90 95}] + {0 0 70 95} {70 0 50 95} {120 0 140 95} {260 0 90 95}] test grid-16.13 {layout span} -body { frame .f1 -width 24 -height 20 frame .f2 -width 38 -height 20 @@ -1643,15 +1643,15 @@ test grid-16.13 {layout span} -body { grid .f3 - - - set res {} foreach w {{0 1 0 0} {0 0 1 0} {1 3 4 0} {1 2 1 2} {1 1 1 12}} { - for {set c 0} {$c < 4} {incr c} { - grid columnconfigure . $c -weight [lindex $w $c] - } - update - set res2 {} - for {set c 0} {$c <= 4} {incr c} { - lappend res2 [lindex [grid bbox . $c 0] 2] - } - lappend res $res2 + for {set c 0} {$c < 4} {incr c} { + grid columnconfigure . $c -weight [lindex $w $c] + } + update + set res2 {} + for {set c 0} {$c <= 4} {incr c} { + lappend res2 [lindex [grid bbox . $c 0] 2] + } + lappend res $res2 } return $res # The last result below should ideally be 8 8 8 126 but the current @@ -1659,7 +1659,7 @@ test grid-16.13 {layout span} -body { } -cleanup { grid_reset 16.13 } -result [list [list 0 112 0 38 0] [list 0 0 112 38 0] [list 14 42 56 38 0] \ - [list 18 38 18 76 0] [list 7 8 9 126 0]] + [list 18 38 18 76 0] [list 7 8 9 126 0]] test grid-16.14 {layout span} -body { frame .f1 -width 110 -height 20 frame .f2 -width 38 -height 20 @@ -1668,21 +1668,21 @@ test grid-16.14 {layout span} -body { grid .f3 - - - set res {} foreach w {{0 1 0 0} {0 0 1 0} {1 3 4 0} {1 2 1 3} {1 1 1 12}} { - for {set c 0} {$c < 4} {incr c} { - grid columnconfigure . $c -weight [lindex $w $c] - } - update - set res2 {} - for {set c 0} {$c <= 4} {incr c} { - lappend res2 [lindex [grid bbox . $c 0] 2] - } - lappend res $res2 + for {set c 0} {$c < 4} {incr c} { + grid columnconfigure . $c -weight [lindex $w $c] + } + update + set res2 {} + for {set c 0} {$c <= 4} {incr c} { + lappend res2 [lindex [grid bbox . $c 0] 2] + } + lappend res $res2 } return $res } -cleanup { grid_reset 16.14 } -result [list [list 0 112 0 38 0] [list 0 0 112 38 0] [list 14 42 56 38 0] \ - [list 27 55 28 40 0] [list 36 37 37 40 0]] + [list 27 55 28 40 0] [list 36 37 37 40 0]] test grid-16.15 {layout span} -body { frame .f1 -width 24 -height 20 frame .f2 -width 38 -height 20 @@ -1691,21 +1691,21 @@ test grid-16.15 {layout span} -body { grid x .f3 - - set res {} foreach w {{0 1 0 0} {0 0 1 0} {1 0 1 0} {0 0 0 0} {1 0 0 6}} { - for {set c 0} {$c < 4} {incr c} { - grid columnconfigure . $c -weight [lindex $w $c] - } - update - set res2 {} - for {set c 0} {$c <= 4} {incr c} { - lappend res2 [lindex [grid bbox . $c 0] 2] - } - lappend res $res2 + for {set c 0} {$c < 4} {incr c} { + grid columnconfigure . $c -weight [lindex $w $c] + } + update + set res2 {} + for {set c 0} {$c <= 4} {incr c} { + lappend res2 [lindex [grid bbox . $c 0] 2] + } + lappend res $res2 } return $res } -cleanup { grid_reset 16.15 } -result [list [list 0 112 0 38 0] [list 0 0 112 38 0] [list 0 0 112 38 0] \ - [list 0 37 37 76 0] [list 0 12 12 126 0]] + [list 0 37 37 76 0] [list 0 12 12 126 0]] test grid-16.16 {layout span} -body { frame .f1 -width 64 -height 20 frame .f2 -width 38 -height 20 @@ -1718,21 +1718,21 @@ test grid-16.16 {layout span} -body { grid .f4 .f5 .f6 set res {} foreach w {{1 1 5 1} {0 0 1 0} {1 3 4 0} {1 2 1 2} {1 1 1 12}} { - for {set c 0} {$c < 4} {incr c} { - grid columnconfigure . $c -weight [lindex $w $c] - } - update - set res2 {} - for {set c 0} {$c <= 4} {incr c} { - lappend res2 [lindex [grid bbox . $c 0] 2] - } - lappend res $res2 + for {set c 0} {$c < 4} {incr c} { + grid columnconfigure . $c -weight [lindex $w $c] + } + update + set res2 {} + for {set c 0} {$c <= 4} {incr c} { + lappend res2 [lindex [grid bbox . $c 0] 2] + } + lappend res $res2 } return $res } -cleanup { grid_reset 16.16 } -result [list [list 30 34 43 43 0] [list 30 34 48 38 0] [list 22 42 48 38 0] \ - [list 25 39 29 57 0] [list 30 34 22 64 0]] + [list 25 39 29 57 0] [list 30 34 22 64 0]] test grid-16.17 {layout weights (shrinking at minsize)} -body { foreach i {0 1 2 3} { frame .$i -bg gray -width 100 -height 75 -bd 2 -relief ridge @@ -1766,15 +1766,15 @@ test grid-16.18 {layout span} -body { grid columnconfigure . 0 -weight 1 set res {} foreach w {{1 0 0} {0 1 0} {0 0 1}} { - for {set c 0} {$c < 3} {incr c} { - grid columnconfigure . $c -weight [lindex $w $c] - } - update - set res2 {} - for {set c 0} {$c <= 2} {incr c} { - lappend res2 [lindex [grid bbox . $c 0] 2] - } - lappend res $res2 + for {set c 0} {$c < 3} {incr c} { + grid columnconfigure . $c -weight [lindex $w $c] + } + update + set res2 {} + for {set c 0} {$c <= 2} {incr c} { + lappend res2 [lindex [grid bbox . $c 0] 2] + } + lappend res $res2 } return $res } -cleanup { @@ -1795,7 +1795,7 @@ test grid-16.19 {layout span} -constraints { knownBug } -body { set res {} update for {set c 0} {$c <= 5} {incr c} { - lappend res [lindex [grid bbox . $c 0] 2] + lappend res [lindex [grid bbox . $c 0] 2] } return $res } -cleanup { @@ -1861,10 +1861,10 @@ test grid-18.2 {test support for minreqsize} -body { test grid-19.1 {uniform realloc} -body { # Use a lot of uniform groups to test the reallocation mechanism for {set t 0} {$t < 100} {incr t 2} { - frame .fa$t -width 5 -height 20 - frame .fb$t -width 6 -height 20 - grid .fa$t .fb$t -row 0 -column $t -sticky news - grid columnconfigure . [list $t [expr {$t + 1}]] -uniform a$t + frame .fa$t -width 5 -height 20 + frame .fb$t -width 6 -height 20 + grid .fa$t .fb$t -row 0 -column $t -sticky news + grid columnconfigure . [list $t [expr {$t + 1}]] -uniform a$t } update grid bbox . @@ -1927,16 +1927,16 @@ test grid-21.6 {anchor} -body { . configure -width 300 -height 250 set res {} foreach a {n ne e se s sw w nw center} { - grid anchor . $a - update - lappend res [grid bbox .] + grid anchor . $a + update + lappend res [grid bbox .] } return $res } -cleanup { grid_reset 21.6 } -result [list {37 0 225 150} {75 0 225 150} {75 50 225 150} {75 100 225 150} \ - {37 100 225 150} {0 100 225 150} {0 50 225 150} {0 0 225 150} \ - {37 50 225 150}] + {37 100 225 150} {0 100 225 150} {0 50 225 150} {0 0 225 150} \ + {37 50 225 150}] test grid-21.7 {anchor} -body { # Test with a non-symmetric internal border. # This only tests vertically, there is currently no way to get @@ -1954,17 +1954,17 @@ test grid-21.7 {anchor} -body { . configure -width 300 -height 250 set res {} foreach a {n ne e se s sw w nw center} { - grid anchor .f $a - update - lappend res [grid bbox .f] + grid anchor .f $a + update + lappend res [grid bbox .f] } pack propagate . 1 ; wm geometry . {} return $res } -cleanup { grid_reset 21.7 } -result [list {37 20 225 150} {75 20 225 150} {75 60 225 150} {75 100 225 150} \ - {37 100 225 150} {0 100 225 150} {0 60 225 150} {0 20 225 150} \ - {37 60 225 150}] + {37 100 225 150} {0 100 225 150} {0 60 225 150} {0 20 225 150} \ + {37 60 225 150}] test grid-22.1 {remove: basic argument checking} { list [catch {grid remove foo} msg] $msg @@ -2022,7 +2022,7 @@ test grid-22.5 {remove} { grid_reset 22.5 test grid-23 {grid configure -in leaked from previous container window - bug - 6aea69fccbb266b7f0437686379fbe5b55442958} { + 6aea69fccbb266b7f0437686379fbe5b55442958} { frame .f frame .g pack .f .g diff --git a/tests/image.test b/tests/image.test index c7b6511..e6f166b 100644 --- a/tests/image.test +++ b/tests/image.test @@ -31,7 +31,7 @@ test image-1.3 {Tk_ImageCmd procedure, "create" option} -body { } -returnCodes error -result {wrong # args: should be "image create type ?name? ?-option value ...?"} test image-1.4 {Tk_ImageCmd procedure, "create" option} -body { image c bad_type -} -returnCodes error -result {image type "bad_type" doesn't exist} +} -returnCodes error -result {image type "bad_type" does not exist} test image-1.5 {Tk_ImageCmd procedure, "create" option} -constraints { testImageType } -body { @@ -68,7 +68,7 @@ test image-1.7 {Tk_ImageCmd procedure, "create" option} -constraints { update # On MacOS we need to wait for the test image display procedure to run. while {"timed out" ni $x && [lindex $x end 1] ne "display"} { - vwait x + vwait x } after cancel timer if {[lindex $x end] eq "timed out"} { @@ -177,7 +177,7 @@ test image-2.3 {Tk_ImageCmd procedure, "delete" option} -constraints { image delete myimage gorp img2 } -cleanup { imageCleanup -} -returnCodes error -result {image "gorp" doesn't exist} +} -returnCodes error -result {image "gorp" does not exist} test image-2.4 {Tk_ImageCmd procedure, "delete" option} -constraints { testImageType } -setup { @@ -200,7 +200,7 @@ test image-3.2 {Tk_ImageCmd procedure, "height" option} -body { } -returnCodes error -result {wrong # args: should be "image height name"} test image-3.3 {Tk_ImageCmd procedure, "height" option} -body { image height foo -} -returnCodes error -result {image "foo" doesn't exist} +} -returnCodes error -result {image "foo" does not exist} test image-3.4 {Tk_ImageCmd procedure, "height" option} -constraints { testImageType } -setup { @@ -226,11 +226,11 @@ test image-4.2 {Tk_ImageCmd procedure, "names" option} -constraints { interp create testinterp load {} Tk testinterp interp eval testinterp { - image delete {*}[image names] - image create test myimage - image create test img2 - image create test 24613 - lsort [image names] + image delete {*}[image names] + image create test myimage + image create test img2 + image create test 24613 + lsort [image names] } } -cleanup { interp delete testinterp @@ -241,9 +241,9 @@ test image-4.3 {Tk_ImageCmd procedure, "names" option} -setup { interp create testinterp load {} Tk testinterp interp eval testinterp { - image delete {*}[image names] - eval image delete [image names] [image names] - lsort [image names] + image delete {*}[image names] + eval image delete [image names] [image names] + lsort [image names] } } -cleanup { interp delete testinterp @@ -258,7 +258,7 @@ test image-5.2 {Tk_ImageCmd procedure, "type" option} -body { } -returnCodes error -result {wrong # args: should be "image type name"} test image-5.3 {Tk_ImageCmd procedure, "type" option} -body { image type foo -} -returnCodes error -result {image "foo" doesn't exist} +} -returnCodes error -result {image "foo" does not exist} test image-5.4 {Tk_ImageCmd procedure, "type" option} -constraints { testImageType @@ -281,7 +281,7 @@ test image-5.5 {Tk_ImageCmd procedure, "type" option} -constraints { image type myimage } -cleanup { imageCleanup -} -returnCodes error -result {image "myimage" doesn't exist} +} -returnCodes error -result {image "myimage" does not exist} test image-5.6 {Tk_ImageCmd procedure, "type" option} -constraints { testOldImageType } -setup { @@ -326,7 +326,7 @@ test image-7.2 {Tk_ImageCmd procedure, "width" option} -body { } -returnCodes error -result {wrong # args: should be "image width name"} test image-7.3 {Tk_ImageCmd procedure, "width" option} -body { image width foo -} -returnCodes error -result {image "foo" doesn't exist} +} -returnCodes error -result {image "foo" does not exist} test image-7.4 {Tk_ImageCmd procedure, "width" option} -constraints { testImageType } -setup { @@ -370,10 +370,6 @@ test image-9.1 {Tk_ImageChanged procedure} -constraints testImageType -setup { foo changed 5 6 7 8 30 15 update idletasks update - # On MacOS we need to wait for the test image display procedure to run. - while {"timed out" ni $x && [lindex $x end 1] ne "display"} { - vwait x - } after cancel $timer return $x } -cleanup { @@ -408,7 +404,7 @@ test image-10.1 {Tk_GetImage procedure} -setup { .c create image 100 10 -image bad_name } -cleanup { imageCleanup -} -returnCodes error -result {image "bad_name" doesn't exist} +} -returnCodes error -result {image "bad_name" does not exist} test image-10.2 {Tk_GetImage procedure} -constraints testImageType -setup { destroy .l imageCleanup @@ -420,7 +416,7 @@ test image-10.2 {Tk_GetImage procedure} -constraints testImageType -setup { } -cleanup { destroy .l imageCleanup -} -returnCodes error -result {image "mytest" doesn't exist} +} -returnCodes error -result {image "mytest" does not exist} test image-11.1 {Tk_FreeImage procedure} -constraints testImageType -setup { @@ -581,7 +577,7 @@ test image-13.2 {DeleteImage procedure} -constraints testImageType -setup { lappend x | [imageNames] | [catch {image delete foo} msg] | $msg | [imageNames] | } -cleanup { imageCleanup -} -result {{foo free} {foo free} {foo delete} | {} | 1 | {image "foo" doesn't exist} | {} |} +} -result {{foo free} {foo free} {foo delete} | {} | 1 | {image "foo" does not exist} | {} |} test image-13.3 {Tk_SizeOfImage procedure} -constraints testOldImageType -setup { imageCleanup diff --git a/tests/imgBmap.test b/tests/imgBmap.test index ecb098e..c498c90 100644 --- a/tests/imgBmap.test +++ b/tests/imgBmap.test @@ -157,7 +157,7 @@ test imageBmap-3.3 {ImgBmapConfigureModel procedure, memory de-allocation} -body test imageBmap-3.4 {ImgBmapConfigureModel procedure} -body { image create bitmap i1 i1 configure -maskdata $data2 -} -returnCodes error -result {can't have mask without bitmap} +} -returnCodes error -result {cannot have a mask without a bitmap} test imageBmap-3.5 {ImgBmapConfigureModel procedure} -body { image create bitmap i1 -data $data1 -maskdata { #define foo_width 8 diff --git a/tests/imgListFormat.test b/tests/imgListFormat.test index 3c6da21..f7f2553 100644 --- a/tests/imgListFormat.test +++ b/tests/imgListFormat.test @@ -112,12 +112,12 @@ test imgListFormat-3.1 {StringMatchDef: data is not a list} -body { } -returnCodes error -result {unmatched open quote in list} # empty data case tested with imgPhoto-4.95 (imgPhoto.test) test imgListFormat-3.2 {StringMatchDef: \ - list element not a proper list} -body { + list element not a proper list} -body { testphotostringmatch {{red white} {not "} {blue green}} # " } -returnCodes error -result {unmatched open quote in list} test imgListFormat-3.3 {StringMatchDef: \ - sublists with differen lengths} -body { + sublists with differen lengths} -body { testphotostringmatch {{#001122 #334455 #667788} {#99AABB #CCDDEE} {#FF0011 #223344 #556677}} @@ -141,7 +141,7 @@ test imgListFormat-3.5 {StringMatchDef: valid data} -setup { } -body { photo1 put {{blue green} {yellow magenta} - {#000000 #FFFFFFFF}} + {#000000 #FFFFFFFF}} list [image width photo1] [image height photo1] \ [photo1 get 0 2 -withalpha] } -cleanup { @@ -334,7 +334,7 @@ test imgListFormat-6.3 {ParseColor: color name too long} -setup { image create photo photo1 set longstr {} for {set i 1} {$i <= 100} {incr i} { - append longstr "z" + append longstr "z" } } -body { photo1 put [list [list blue] [list $longstr]] @@ -510,7 +510,7 @@ test imgListFormat-8.4 {ParseColor: valid #RGBA color} -setup { } -result {{155 213 2 13} {119 170 204 255}} test imgListFormat-9.1 {ParseColorAsStandard: - Tk color, valid suffixes} -setup { + Tk color, valid suffixes} -setup { image create photo photo1 set result {} } -body { @@ -525,7 +525,7 @@ test imgListFormat-9.1 {ParseColorAsStandard: imageCleanup } -result {{0 0 255 181} {17 68 51 204} {136 221 68 26} {255 0 255 255}} test imgListFormat-9.2 {ParseColorAsStandard: - Tk color with and w/o suffixes} -setup { + Tk color with and w/o suffixes} -setup { image create photo photo1 set result {} } -body { @@ -587,7 +587,7 @@ test imgListFormat-9.8 {ParseColorAsStandard: # suffix, no hex digits} -setup { imageCleanup } -returnCodes error -result {invalid alpha suffix "#"} test imgListFormat-9.9 {ParseColorAsStandard: - '#' suffix, too many digits} -setup { + '#' suffix, too many digits} -setup { image create photo photo1 } -body { photo1 put {{#ABC#12 #ABC#123}} @@ -595,7 +595,7 @@ test imgListFormat-9.9 {ParseColorAsStandard: imageCleanup } -returnCodes error -result {invalid alpha suffix "#123"} test imgListFormat-9.10 {ParseColorAsStandard: - invalid digit in #X suffix} -setup { + invalid digit in #X suffix} -setup { image create photo photo1 } -body { photo1 put {#000#a #000#g} @@ -603,7 +603,7 @@ test imgListFormat-9.10 {ParseColorAsStandard: imageCleanup } -returnCodes error -result {invalid alpha suffix "#g": expected hex digit} test imgListFormat-9.11 {ParseColorAsStandard: - invalid digit in #XX suffix} -setup { + invalid digit in #XX suffix} -setup { image create photo photo1 } -body { photo1 put {green#2 green#2W} @@ -611,7 +611,7 @@ test imgListFormat-9.11 {ParseColorAsStandard: imageCleanup } -returnCodes error -result {invalid alpha suffix "#2W": expected hex digit} test imgListFormat-9.12 {ParseColorAsStandard: - invalid color: not a hex digit} -setup { + invalid color: not a hex digit} -setup { image create photo photo1 } -body { photo1 put {#ABCDEF@.99 #ABCDEG@.99} diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 0a2cf7f..e292d94 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -365,7 +365,7 @@ test imgPhoto-4.12 {ImgPhotoCmd procedure: copy option} -setup { photo1 copy blah } -returnCodes error -cleanup { image delete photo1 -} -result {image "blah" doesn't exist or is not a photo image} +} -result {image "blah" does not exist or is not a photo image} test imgPhoto-4.13 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 @@ -1018,7 +1018,7 @@ test imgPhoto-4.87 {ImgPhotoCmd, transparency set: no opt} -setup { photo1 transparency set 0 0 0 photo1 transparency set 1 0 1 list [photo1 transparency get 0 0 -alpha] \ - [photo1 transparency get 1 0 -alpha] + [photo1 transparency get 1 0 -alpha] } -cleanup { imageCleanup } -result {255 0} @@ -1064,17 +1064,17 @@ test imgPhoto-4.93 {ImgPhotoCmd put: data in ppm format} -setup { photo2 put $imgdata -format ppm set result {} if {[image width photo1] != [image width photo2] \ - || [image height photo1] != [image height photo2]} { - lappend result [list [image width photo2] [image height photo2]] + || [image height photo1] != [image height photo2]} { + lappend result [list [image width photo2] [image height photo2]] } else { - lappend result 1 + lappend result 1 } foreach point {{206 125} {67 12} {13 46} {19 184}} { - if {[photo1 get {*}$point] ne [photo2 get {*}$point]} { - lappend result [photo2 get {*}$point] - } else { - lappend result 1 - } + if {[photo1 get {*}$point] ne [photo2 get {*}$point]} { + lappend result [photo2 get {*}$point] + } else { + lappend result 1 + } } set result } -cleanup { @@ -1099,7 +1099,7 @@ test imgPhoto-4.96 {ImgPhotoCmd put: "default" handler is selected} -setup { image create photo photo1 image create photo photo2 set imgData {{{1 2 3 4} {5 6 7 8} {9 10 11 12}} - {{13 14 15 15} {17 18 19 20} {21 22 23 24}}} + {{13 14 15 15} {17 18 19 20} {21 22 23 24}}} } -body { photo1 put $imgData photo2 put $imgData -format default @@ -1107,8 +1107,8 @@ test imgPhoto-4.96 {ImgPhotoCmd put: "default" handler is selected} -setup { lappend result [list [image width photo1] [image height photo1]] lappend result [list [image width photo2] [image height photo2]] lappend result [string equal \ - [photo1 data -format "default -colorformat rgba"] \ - [photo2 data -format "default -colorformat rgba"]] + [photo1 data -format "default -colorformat rgba"] \ + [photo2 data -format "default -colorformat rgba"]] set result } -cleanup { imageCleanup @@ -1246,9 +1246,9 @@ test imgPhoto-4.111 {ImgPhotoCmd data: invalid -from coords #4} -setup { {coordinates for -from option extend outside image} test imgPhoto-4.112 {ImgPhotoCmd data: -from with 2 coords} -setup { image create photo photo1 -data { - {black black black black black} - {white white white white white} - {green green green green green}} + {black black black black black} + {white white white white white} + {green green green green green}} } -body { set imgData [photo1 data -from 2 1] list [llength [lindex $imgData 0]] [llength $imgData] @@ -1288,7 +1288,7 @@ test imgPhoto-4.117 {ImgPhotoCmd data: list colorformat} -setup { # This testcase fails with Tcl < 8.6.7, due to [25842c] test imgPhoto-4.118 {ImgPhotoCmd data: using data for new image results in same image as orignial } -constraints { - needsTcl867 + needsTcl867 } -setup { image create photo teapot -file $teapotPhotoFile teapot copy teapot -from 50 60 70 80 -shrink @@ -1300,19 +1300,19 @@ test imgPhoto-4.118 {ImgPhotoCmd data: using data for new image # We don't test gif here, as there seems to be a problem with # <imgName> data and gif format ("too many colors", probably a bug) foreach fmt {ppm png {default -colorformat rgba} \ - {default -colorformat list}} { - set imgData [teapotTransp data -format $fmt] - photo1 blank - photo1 put $imgData - if { ! [string equal [photo1 data] [teapotTransp data]]} { - lappend result $fmt - } + {default -colorformat list}} { + set imgData [teapotTransp data -format $fmt] + photo1 blank + photo1 put $imgData + if { ! [string equal [photo1 data] [teapotTransp data]]} { + lappend result $fmt + } } set imgData [teapot data -format default] photo1 blank photo1 put $imgData if { ! [string equal [photo1 data] [teapot data]]} { - lappend result default + lappend result default } set result } -cleanup { @@ -1431,7 +1431,7 @@ test imgPhoto-8.3 {ImgPhotoDelete procedure, name cleanup} -body { photo1 copy photo2 } -returnCodes error -cleanup { imageCleanup -} -result {image "photo2" doesn't exist or is not a photo image} +} -result {image "photo2" does not exist or is not a photo image} test imgPhoto-9.1 {ImgPhotoCmdDeletedProc procedure} -body { image create photo photo2 -file $teapotPhotoFile @@ -1488,7 +1488,7 @@ test imgPhoto-11.1 {Tk_FindPhoto} -setup { photo1 copy i1 } -cleanup { imageCleanup -} -returnCodes error -result {image "i1" doesn't exist or is not a photo image} +} -returnCodes error -result {image "i1" does not exist or is not a photo image} test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} -body { image create photo p3 -file $teapotPhotoFile @@ -1824,7 +1824,7 @@ test imgPhoto-19.1 {MatchStringFormat: with "-format default"} -setup { imageCleanup } -result {3 2} test imgPhoto-19.2 {MatchStringFormat: without -format option, - default fmt} -body { + default fmt} -body { image create photo photo1 photo1 put {{red} {green}} list [image width photo1] [image height photo1] @@ -2062,9 +2062,9 @@ test imgPhoto-21.4 {bug daa10097: only 3 metadata list items on configure} -setu } -body { set a {} foreach line [photo1 configure] { - if {[lindex $line 0] eq {-metadata}} { - set a $line - } + if {[lindex $line 0] eq {-metadata}} { + set a $line + } } set a } -cleanup { diff --git a/tests/imgSVGnano.test b/tests/imgSVGnano.test index 2da15e7..dc1bf45 100644 --- a/tests/imgSVGnano.test +++ b/tests/imgSVGnano.test @@ -16,18 +16,18 @@ namespace eval svgnano { variable data set data(plus) {\ - <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"> - <path fill="none" stroke="#000000" d="M0 0 h16 v16 h-16 z"/> - <path fill="none" stroke="#000000" d="M8 4 v 8 M4 8 h 8"/> - <circle fill="yellow" stroke="red" cx="10" cy="80" r="10" /> - <ellipse fill="none" stroke="blue" stroke-width="3" cx="60" cy="60" rx="10" ry="20" /> - <line x1="10" y1="90" x2="50" y2="99"/> - <rect fill="none" stroke="green" x="20" y="20" width="60" height="50" rx="3" ry="3"/> - <polyline fill="red" stroke="purple" points="80,10 90,20 85,40"/> - <polygon fill ="yellow" points="80,80 70,85 90,90"/> - </svg>} - set data(bad) {<svg xmlns="http://www.w3.org/2000/svg" width="0" height="0:w"> - </svg>\ + <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"> + <path fill="none" stroke="#000000" d="M0 0 h16 v16 h-16 z"/> + <path fill="none" stroke="#000000" d="M8 4 v 8 M4 8 h 8"/> + <circle fill="yellow" stroke="red" cx="10" cy="80" r="10" /> + <ellipse fill="none" stroke="blue" stroke-width="3" cx="60" cy="60" rx="10" ry="20" /> + <line x1="10" y1="90" x2="50" y2="99"/> + <rect fill="none" stroke="green" x="20" y="20" width="60" height="50" rx="3" ry="3"/> + <polyline fill="red" stroke="purple" points="80,10 90,20 85,40"/> + <polygon fill ="yellow" points="80,80 70,85 90,90"/> + </svg>} + set data(bad) {<svg xmlns="http://www.w3.org/2000/svg" width="0" height="0:w"> + </svg>\ } tcltest::makeFile $data(plus) plus.svg diff --git a/tests/listbox.test b/tests/listbox.test index c02f389..c4b7c15 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -107,7 +107,7 @@ test listbox-1.9 {configuration options} -body { list [lindex [.l configure -borderwidth] 4] [.l cget -borderwidth] } -cleanup { .l configure -borderwidth [lindex [.l configure -borderwidth] 3] -} -result {1 1} +} -result {1.3 1.3} test listbox-1.10 {configuration options} -body { .l configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} @@ -242,7 +242,7 @@ test listbox-1.37 {configuration options} -body { list [lindex [.l configure -selectborderwidth] 4] [.l cget -selectborderwidth] } -cleanup { .l configure -selectborderwidth [lindex [.l configure -selectborderwidth] 3] -} -result {1 1} +} -result {1.3 1.3} test listbox-1.38 {configuration options} -body { .l configure -selectborderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} @@ -502,7 +502,7 @@ test listbox-3.18b {ListboxWidgetCmd procedure, "bbox" option, justified, non-de lappend lres [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2] set res 1 for {set i 0} {$i < [llength $lres]} {incr i 4} { - set res [expr {$res * [expr {[lindex $lres $i] >= 0}] }] + set res [expr {$res * [expr {[lindex $lres $i] >= 0}] }] } set res } -cleanup { @@ -3188,7 +3188,7 @@ test listbox-32.1 {Bug [5d991b822e]} { set var INIT listbox .b -listvariable var trace add variable var unset {apply {args { - .b configure -listvariable {} + .b configure -listvariable {} }}} pack .b bind .b <Configure> {unset var} @@ -3201,7 +3201,7 @@ test listbox-32.2 {Bug [5d991b822e]} { set var INIT listbox .b -listvariable var trace add variable var unset {apply {args { - .b configure -listvariable new + .b configure -listvariable new }}} pack .b bind .b <Configure> {unset -nocomplain var} diff --git a/tests/main.test b/tests/main.test index 6b9f598..e481542 100644 --- a/tests/main.test +++ b/tests/main.test @@ -56,16 +56,16 @@ test main-2.2 {Tk_MainEx: -encoding option} -constraints stdio -setup { # Procedure to simulate interactive typing of commands, line by line, # for test 2.3 proc type {chan script} { - foreach line [split $script \n] { - if {[catch { - puts $chan $line - flush $chan - }]} { - return - } - # Grrr... Behavior depends on this value. - after 1000 - } + foreach line [split $script \n] { + if {[catch { + puts $chan $line + flush $chan + }]} { + return + } + # Grrr... Behavior depends on this value. + after 1000 + } } test main-2.3 {Tk_MainEx: -encoding option} -constraints stdio -setup { diff --git a/tests/menu.test b/tests/menu.test index 72369b5..5828879 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -746,11 +746,11 @@ test menu-2.127 {entry configuration options 0 -image bogus tearoff} -body { test menu-2.128 {entry configuration options 1 -image bogus command} -body { .m1 entryconfigure 1 -image bogus -} -returnCodes error -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test menu-2.129 {entry configuration options 2 -image bogus cascade} -body { .m1 entryconfigure 2 -image bogus -} -returnCodes error -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test menu-2.130 {entry configuration options 3 -image bogus separator} -body { .m1 entryconfigure 3 -image bogus @@ -758,11 +758,11 @@ test menu-2.130 {entry configuration options 3 -image bogus separator} -body { test menu-2.131 {entry configuration options 4 -image bogus checkbutton} -body { .m1 entryconfigure 4 -image bogus -} -returnCodes error -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test menu-2.132 {entry configuration options 5 -image bogus radiobutton} -body { .m1 entryconfigure 5 -image bogus -} -returnCodes error -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test menu-2.133 {entry configuration options 0 -image {} tearoff} -body { .m1 entryconfigure 0 -image @@ -1027,11 +1027,11 @@ test menu-2.190 {entry configuration options 3 -selectimage bogus separator} -bo test menu-2.191 {entry configuration options 4 -selectimage bogus checkbutton} -body { .m1 entryconfigure 4 -selectimage bogus -} -returnCodes error -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test menu-2.192 {entry configuration options 5 -selectimage bogus radiobutton} -body { .m1 entryconfigure 5 -selectimage bogus -} -returnCodes error -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test menu-2.193 {entry configuration options 0 -selectimage {} tearoff} -body { .m1 entryconfigure 0 -selectimage @@ -1865,7 +1865,7 @@ test menu-4.3 {TkInvokeMenu: checkbutton -on} -setup { menu .m1 .m1 add checkbutton -label "test" -variable foo -onvalue on -offvalue off list [catch {.m1 invoke 1} msg] $msg [catch {set foo} msg2] $msg2 \ - [catch {unset foo} msg3] $msg3 + [catch {unset foo} msg3] $msg3 } -cleanup { destroy .m1 } -result {0 {} 0 on 0 {}} @@ -3098,9 +3098,9 @@ test menu-16.19 {MenuAddOrInsert - Insert a cascade deep into the tree} -setup { .menubar.test.cascade add command -label SubItem -command "puts SubItemSelected" . configure -menu .menubar list [catch {.menubar.test add cascade -label SubMenu \ - -menu .menubar.test.cascade}] \ - [info commands .\#menubar.\#menubar\#test.\#menubar\#test\#cascade] \ - [. configure -menu ""] + -menu .menubar.test.cascade}] \ + [info commands .\#menubar.\#menubar\#test.\#menubar\#test\#cascade] \ + [. configure -menu ""] } -cleanup { deleteWindows } -result {0 .#menubar.#menubar#test.#menubar#test#cascade {}} @@ -3113,7 +3113,7 @@ test menu-17.1 {MenuVarProc} -setup { menu .m1 set foo "hello" list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \ - [unset foo] + [unset foo] } -cleanup { deleteWindows } -result {e001 {}} @@ -3124,7 +3124,7 @@ test menu-17.2 {MenuVarProc} -setup { catch {unset foo} menu .m1 list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \ - [set foo ""] + [set foo ""] } -cleanup { deleteWindows } -result {e001 {}} @@ -3135,7 +3135,7 @@ test menu-17.3 {MenuVarProc} -setup { menu .m1 set foo "hello" list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \ - [set foo "hello"] [unset foo] + [set foo "hello"] [unset foo] } -cleanup { deleteWindows } -result {e001 hello {}} @@ -3145,7 +3145,7 @@ test menu-17.4 {MenuVarProc} -setup { menu .m1 set foo "goodbye" list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \ - [set foo "hello"] [unset foo] + [set foo "hello"] [unset foo] } -cleanup { deleteWindows } -result {e001 hello {}} @@ -3155,7 +3155,7 @@ test menu-17.5 {MenuVarProc} -setup { menu .m1 set foo "hello" list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \ - [set foo "goodbye"] [unset foo] + [set foo "goodbye"] [unset foo] } -cleanup { deleteWindows } -result {e001 goodbye {}} @@ -3167,7 +3167,7 @@ test menu-17.6 {MenuVarProc [5d991b822e]} -setup { set var INIT .b add checkbutton -variable var trace add variable var unset {apply {args { - .b entryconfigure 1 -variable {} + .b entryconfigure 1 -variable {} }}} unset var } -cleanup { @@ -3181,7 +3181,7 @@ test menu-17.7 {MenuVarProc [5d991b822e]} -setup { set var INIT .b add checkbutton -variable var trace add variable var unset {apply {args { - .b entryconfigure 1 -variable new + .b entryconfigure 1 -variable new }}} unset var } -cleanup { @@ -3580,7 +3580,7 @@ test menu-24.3 {TkNewMenuName} -setup { menu .#m rename .#m hideme list [catch {. configure -menu [menu .m]}] [. configure -menu ""] [destroy .#m] \ - [destroy .m] [destroy hideme] + [destroy .m] [destroy hideme] } -result {0 {} {} {} {}} @@ -3937,7 +3937,7 @@ test menu-32.6 {DeleteMenuCloneEntries - reentrancy - crashes tk8.0} -setup { } -body { menu .m1 .m1 add command -label test \ - -command ".m1 delete test ; .m1 add command -label test -command \".m1 delete test\"; .m1 delete test" + -command ".m1 delete test ; .m1 add command -label test -command \".m1 delete test\"; .m1 delete test" .m1 invoke test } -cleanup { deleteWindows @@ -3960,8 +3960,8 @@ test menu-32.8 {Ensure all menu clone commands are deleted} -setup { menu .menubar.test .menubar.test add command -label "hi" for {set i 0} {$i < 10} {incr i} { - .menubar add cascade -menu .menubar.test -label "Test" - .menubar delete Test + .menubar add cascade -menu .menubar.test -label "Test" + .menubar delete Test } info commands .#menubar*test* diff --git a/tests/menuDraw.test b/tests/menuDraw.test index 2cafc31..9456ae1 100644 --- a/tests/menuDraw.test +++ b/tests/menuDraw.test @@ -50,7 +50,7 @@ test menuDraw-4.2 {TkMenuEntryFreeDrawOptions} -setup { } -body { menu .m1 .m1 add checkbutton -label "This is a test." -font "Courier 12" \ - -activeforeground red -background green -selectcolor purple + -activeforeground red -background green -selectcolor purple destroy .m1 } -result {} @@ -683,9 +683,9 @@ test menuDraw-17.1 {AdjustMenuCoords - menubar} -constraints unix -setup { .m2 add command -label foo . configure -menu .m1 foreach w [winfo children .] { - if {[$w cget -type] == "menubar"} { - break - } + if {[$w cget -type] == "menubar"} { + break + } } list [$w postcascade 0] [. configure -menu ""] } -cleanup { diff --git a/tests/menubut.test b/tests/menubut.test index 028341f..f997e55 100644 --- a/tests/menubut.test +++ b/tests/menubut.test @@ -98,7 +98,7 @@ test menubutton-1.15 {configuration options} -body { .mb cget -borderwidth } -cleanup { .mb configure -borderwidth [lindex [.mb configure -borderwidth] 3] -} -result 1 +} -result 1.3 test menubutton-1.16 {configuration options} -body { .mb configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} @@ -207,7 +207,7 @@ test menubutton-1.37 {configuration options} -setup { .mb configure -image bogus } -cleanup { .mb configure -image [lindex [.mb configure -image] 3] -} -returnCodes error -result {image "bogus" doesn't exist} +} -returnCodes error -result {image "bogus" does not exist} test menubutton-1.38 {configuration options} -body { .mb configure -indicatoron yes .mb cget -indicatoron @@ -593,7 +593,7 @@ test menubutton-7.4 {ComputeMenuButtonGeometry procedure} -constraints { image create test image1 } -body { menubutton .mb -image image1 -bd 2 -relief raised -width 40 \ - -highlightthickness 2 + -highlightthickness 2 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -607,7 +607,7 @@ test menubutton-7.5 {ComputeMenuButtonGeometry procedure} -constraints { image create test image1 } -body { menubutton .mb -image image1 -bd 2 -relief raised -height 30 \ - -highlightthickness 2 + -highlightthickness 2 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -618,7 +618,7 @@ test menubutton-7.6 {ComputeMenuButtonGeometry procedure} -setup { deleteWindows } -body { menubutton .mb -bitmap question -bd 2 -relief raised \ - -highlightthickness 2 + -highlightthickness 2 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -628,7 +628,7 @@ test menubutton-7.7 {ComputeMenuButtonGeometry procedure} -setup { deleteWindows } -body { menubutton .mb -bitmap question -bd 2 -relief raised -width 40 \ - -highlightthickness 1 + -highlightthickness 1 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -638,7 +638,7 @@ test menubutton-7.8 {ComputeMenuButtonGeometry procedure} -setup { deleteWindows } -body { menubutton .mb -bitmap question -bd 2 -relief raised -height 50 \ - -highlightthickness 1 + -highlightthickness 1 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -650,7 +650,7 @@ test menubutton-7.9 {ComputeMenuButtonGeometry procedure} -constraints { deleteWindows } -body { menubutton .mb -text String -bd 2 -relief raised -padx 0 -pady 0 \ - -highlightthickness 1 + -highlightthickness 1 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -662,7 +662,7 @@ test menubutton-7.10 {ComputeMenuButtonGeometry procedure} -constraints { deleteWindows } -body { menubutton .mb -text String -bd 2 -relief raised -width 20 \ - -padx 0 -pady 0 -highlightthickness 1 + -padx 0 -pady 0 -highlightthickness 1 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -674,7 +674,7 @@ test menubutton-7.11 {ComputeMenuButtonGeometry procedure} -constraints { deleteWindows } -body { menubutton .mb -text String -bd 2 -relief raised -height 2 \ - -padx 0 -pady 0 -highlightthickness 1 + -padx 0 -pady 0 -highlightthickness 1 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -686,7 +686,7 @@ test menubutton-7.12 {ComputeMenuButtonGeometry procedure} -constraints { deleteWindows } -body { menubutton .mb -text String -bd 2 -relief raised -padx 10 -pady 5 \ - -highlightthickness 1 + -highlightthickness 1 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -698,7 +698,7 @@ test menubutton-7.13 {ComputeMenuButtonGeometry procedure} -constraints { deleteWindows } -body { menubutton .mb -text String -bd 2 -relief raised \ - -highlightthickness 1 -indicatoron 1 + -highlightthickness 1 -indicatoron 1 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -714,7 +714,7 @@ test menubutton-7.14 {ComputeMenuButtonGeometry procedure} -constraints { # size varies to maintain constant absolute size. menubutton .mb -image image1 -bd 2 -relief raised \ - -highlightthickness 2 -indicatoron 1 + -highlightthickness 2 -indicatoron 1 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -731,7 +731,7 @@ test menubutton-7.15 {ComputeMenuButtonGeometry procedure} -constraints { # size varies to maintain constant absolute size. menubutton .mb -image image1 -bd 2 -relief raised \ - -highlightthickness 2 -indicatoron 1 + -highlightthickness 2 -indicatoron 1 pack .mb list [winfo reqwidth .mb] [winfo reqheight .mb] } -cleanup { @@ -757,7 +757,7 @@ test menubutton-9.1 {Bug [5d991b822e]} { set var INIT menubutton .b -textvariable var trace add variable var unset {apply {args { - .b configure -textvariable {} + .b configure -textvariable {} }}} pack .b bind .b <Configure> {unset var} @@ -770,7 +770,7 @@ test menubutton-9.2 {Bug [5d991b822e]} { set var INIT menubutton .b -textvariable var trace add variable var unset {apply {args { - .b configure -textvariable new + .b configure -textvariable new }}} pack .b bind .b <Configure> {unset -nocomplain var} diff --git a/tests/message.test b/tests/message.test index 4abe2db..311a0ff 100644 --- a/tests/message.test +++ b/tests/message.test @@ -30,7 +30,7 @@ test message-1.2 {configuration option: "anchor"} -setup { .m configure -anchor bogus } -cleanup { destroy .m -} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} +} -returnCodes error -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} test message-1.3 {configuration option: "aspect"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -50,7 +50,7 @@ test message-1.4 {configuration option: "aspect"} -setup { .m configure -aspect bogus } -cleanup { destroy .m -} -returnCodes {error} -result {expected integer but got "bogus"} +} -returnCodes error -result {expected integer but got "bogus"} test message-1.5 {configuration option: "background"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -70,7 +70,7 @@ test message-1.6 {configuration option: "background"} -setup { .m configure -background non-existent } -cleanup { destroy .m -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test message-1.7 {configuration option: "bd"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -90,7 +90,7 @@ test message-1.8 {configuration option: "bd"} -setup { .m configure -bd badValue } -cleanup { destroy .m -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test message-1.9 {configuration option: "bg"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -110,7 +110,7 @@ test message-1.10 {configuration option: "bg"} -setup { .m configure -bg non-existent } -cleanup { destroy .m -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test message-1.11 {configuration option: "borderwidth"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -130,7 +130,7 @@ test message-1.12 {configuration option: "borderwidth"} -setup { .m configure -borderwidth badValue } -cleanup { destroy .m -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test message-1.13 {configuration option: "cursor"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -150,7 +150,7 @@ test message-1.14 {configuration option: "cursor"} -setup { .m configure -cursor badValue } -cleanup { destroy .m -} -returnCodes {error} -result {bad cursor spec "badValue"} +} -returnCodes error -result {bad cursor spec "badValue"} test message-1.15 {configuration option: "fg"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -170,7 +170,7 @@ test message-1.16 {configuration option: "fg"} -setup { .m configure -fg badValue } -cleanup { destroy .m -} -returnCodes {error} -result {unknown color name "badValue"} +} -returnCodes error -result {unknown color name "badValue"} test message-1.17 {configuration option: "font"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -190,7 +190,7 @@ test message-1.18 {configuration option: "font"} -setup { .m configure -font {} } -cleanup { destroy .m -} -returnCodes {error} -result {font "" doesn't exist} +} -returnCodes error -result {font "" does not exist} test message-1.19 {configuration option: "-foreground"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -210,7 +210,7 @@ test message-1.20 {configuration option: "-foreground"} -setup { .m configure -foreground badValue } -cleanup { destroy .m -} -returnCodes {error} -result {unknown color name "badValue"} +} -returnCodes error -result {unknown color name "badValue"} test message-1.21 {configuration option: "highlightbackground"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -230,7 +230,7 @@ test message-1.22 {configuration option: "highlightbackground"} -setup { .m configure -highlightbackground ugly } -cleanup { destroy .m -} -returnCodes {error} -result {unknown color name "ugly"} +} -returnCodes error -result {unknown color name "ugly"} test message-1.23 {configuration option: "highlightcolor"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -250,7 +250,7 @@ test message-1.24 {configuration option: "highlightcolor"} -setup { .m configure -highlightcolor non-existent } -cleanup { destroy .m -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test message-1.25 {configuration option: "highlightthickness"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -270,7 +270,7 @@ test message-1.26 {configuration option: "highlightthickness"} -setup { .m configure -highlightthickness badValue } -cleanup { destroy .m -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test message-1.27 {configuration option: "justify"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -290,7 +290,7 @@ test message-1.28 {configuration option: "justify"} -setup { .m configure -justify bogus } -cleanup { destroy .m -} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} +} -returnCodes error -result {bad justification "bogus": must be left, right, or center} test message-1.29 {configuration option: "padx"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -310,7 +310,7 @@ test message-1.30 {configuration option: "padx"} -setup { .m configure -padx 420x } -cleanup { destroy .m -} -returnCodes {error} -result {expected screen distance or "" but got "420x"} +} -returnCodes error -result {expected screen distance or "" but got "420x"} test message-1.31 {configuration option: "pady"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -330,7 +330,7 @@ test message-1.32 {configuration option: "pady"} -setup { .m configure -pady 420x } -cleanup { destroy .m -} -returnCodes {error} -result {expected screen distance or "" but got "420x"} +} -returnCodes error -result {expected screen distance or "" but got "420x"} test message-1.33 {configuration option: "relief"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -350,7 +350,7 @@ test message-1.34 {configuration option: "relief"} -setup { .m configure -relief badValue } -cleanup { destroy .m -} -returnCodes {error} -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} +} -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} test message-1.35 {configuration options: "text"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} @@ -392,7 +392,7 @@ test message-1.38 {configuration option: "width"} -setup { .m configure -width badValue } -cleanup { destroy .m -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test message-1.39 {configuration options, fallback to default} -setup { message .m -borderwidth -2 -highlightthickness -2 -font {Helvetica -12 bold} pack .m @@ -407,11 +407,11 @@ test message-1.39 {configuration options, fallback to default} -setup { test message-2.1 {Tk_MessageObjCmd procedure} -body { message -} -returnCodes {error} -result {wrong # args: should be "message pathName ?-option value ...?"} +} -returnCodes error -result {wrong # args: should be "message pathName ?-option value ...?"} test message-2.2 {Tk_MessageObjCmd procedure} -body { message foo -} -returnCodes {error} -result {bad window path name "foo"} +} -returnCodes error -result {bad window path name "foo"} test message-2.3 {Tk_MessageObjCmd procedure} -body { catch {message foo} winfo children . @@ -419,7 +419,7 @@ test message-2.3 {Tk_MessageObjCmd procedure} -body { test message-2.4 {Tk_MessageObjCmd procedure} -body { message .s -gorp dump -} -returnCodes {error} -result {unknown option "-gorp"} +} -returnCodes error -result {unknown option "-gorp"} test message-2.5 {Tk_MessageObjCmd procedure} -body { catch {message .s -gorp dump} winfo children . @@ -486,7 +486,7 @@ test message-4.1 {Bug [5d991b822e]} { set var INIT message .b -textvariable var trace add variable var unset {apply {args { - .b configure -textvariable {} + .b configure -textvariable {} }}} pack .b bind .b <Configure> {unset var} @@ -499,7 +499,7 @@ test message-4.2 {Bug [5d991b822e]} { set var INIT message .b -textvariable var trace add variable var unset {apply {args { - .b configure -textvariable new + .b configure -textvariable new }}} pack .b bind .b <Configure> {unset -nocomplain var} diff --git a/tests/msgbox.test b/tests/msgbox.test index 91e52a7..60955a4 100644 --- a/tests/msgbox.test +++ b/tests/msgbox.test @@ -131,49 +131,49 @@ test msgbox-2.2 {tk_messageBox command -icon option} -constraints { } -body { ChooseMsg . abort tk_messageBox -title Hi -message "Please press abort" \ - -type abortretryignore -icon warning + -type abortretryignore -icon warning } -result {abort} test msgbox-2.3 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . abort tk_messageBox -title Hi -message "Please press abort" \ - -type abortretryignore -icon error + -type abortretryignore -icon error } -result {abort} test msgbox-2.4 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . abort tk_messageBox -title Hi -message "Please press abort" \ - -type abortretryignore -icon info + -type abortretryignore -icon info } -result {abort} test msgbox-2.5 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . abort tk_messageBox -title Hi -message "Please press abort" \ - -type abortretryignore -icon question + -type abortretryignore -icon question } -result {abort} test msgbox-2.6 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . abort tk_messageBox -title Hi -message "Please press abort" \ - -type abortretryignore -default abort + -type abortretryignore -default abort } -result {abort} test msgbox-2.7 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . retry tk_messageBox -title Hi -message "Please press retry" \ - -type abortretryignore -default retry + -type abortretryignore -default retry } -result {retry} test msgbox-2.8 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . ignore tk_messageBox -title Hi -message "Please press ignore" \ - -type abortretryignore -default ignore + -type abortretryignore -default ignore } -result {ignore} test msgbox-2.9 {tk_messageBox command} -constraints { nonUnixUserInteraction @@ -186,35 +186,35 @@ test msgbox-2.10 {tk_messageBox command -icon option} -constraints { } -body { ChooseMsg . ok tk_messageBox -title Hi -message "Please press ok" \ - -type ok -icon warning + -type ok -icon warning } -result {ok} test msgbox-2.11 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . ok tk_messageBox -title Hi -message "Please press ok" \ - -type ok -icon error + -type ok -icon error } -result {ok} test msgbox-2.12 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . ok tk_messageBox -title Hi -message "Please press ok" \ - -type ok -icon info + -type ok -icon info } -result {ok} test msgbox-2.13 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . ok tk_messageBox -title Hi -message "Please press ok" \ - -type ok -icon question + -type ok -icon question } -result {ok} test msgbox-2.14 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . ok tk_messageBox -title Hi -message "Please press ok" \ - -type ok -default ok + -type ok -default ok } -result {ok} test msgbox-2.15 {tk_messageBox command} -constraints { nonUnixUserInteraction @@ -227,42 +227,42 @@ test msgbox-2.16 {tk_messageBox command -icon option} -constraints { } -body { ChooseMsg . ok tk_messageBox -title Hi -message "Please press ok" \ - -type okcancel -icon warning + -type okcancel -icon warning } -result {ok} test msgbox-2.17 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . ok tk_messageBox -title Hi -message "Please press ok" \ - -type okcancel -icon error + -type okcancel -icon error } -result {ok} test msgbox-2.18 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . ok tk_messageBox -title Hi -message "Please press ok" \ - -type okcancel -icon info + -type okcancel -icon info } -result {ok} test msgbox-2.19 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . ok tk_messageBox -title Hi -message "Please press ok" \ - -type okcancel -icon question + -type okcancel -icon question } -result {ok} test msgbox-2.20 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . ok tk_messageBox -title Hi -message "Please press ok" \ - -type okcancel -default ok + -type okcancel -default ok } -result {ok} test msgbox-2.21 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . cancel tk_messageBox -title Hi -message "Please press cancel" \ - -type okcancel -default cancel + -type okcancel -default cancel } -result {cancel} test msgbox-2.22 {tk_messageBox command} -constraints { nonUnixUserInteraction @@ -275,42 +275,42 @@ test msgbox-2.23 {tk_messageBox command -icon option} -constraints { } -body { ChooseMsg . retry tk_messageBox -title Hi -message "Please press retry" \ - -type retrycancel -icon warning + -type retrycancel -icon warning } -result {retry} test msgbox-2.24 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . retry tk_messageBox -title Hi -message "Please press retry" \ - -type retrycancel -icon error + -type retrycancel -icon error } -result {retry} test msgbox-2.25 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . retry tk_messageBox -title Hi -message "Please press retry" \ - -type retrycancel -icon info + -type retrycancel -icon info } -result {retry} test msgbox-2.26 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . retry tk_messageBox -title Hi -message "Please press retry" \ - -type retrycancel -icon question + -type retrycancel -icon question } -result {retry} test msgbox-2.27 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . retry tk_messageBox -title Hi -message "Please press retry" \ - -type retrycancel -default retry + -type retrycancel -default retry } -result {retry} test msgbox-2.28 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . cancel tk_messageBox -title Hi -message "Please press cancel" \ - -type retrycancel -default cancel + -type retrycancel -default cancel } -result {cancel} test msgbox-2.29 {tk_messageBox command} -constraints { nonUnixUserInteraction @@ -323,42 +323,42 @@ test msgbox-2.30 {tk_messageBox command -icon option} -constraints { } -body { ChooseMsg . yes tk_messageBox -title Hi -message "Please press yes" \ - -type yesno -icon warning + -type yesno -icon warning } -result {yes} test msgbox-2.31 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . yes tk_messageBox -title Hi -message "Please press yes" \ - -type yesno -icon error + -type yesno -icon error } -result {yes} test msgbox-2.32 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . yes tk_messageBox -title Hi -message "Please press yes" \ - -type yesno -icon info + -type yesno -icon info } -result {yes} test msgbox-2.33 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . yes tk_messageBox -title Hi -message "Please press yes" \ - -type yesno -icon question + -type yesno -icon question } -result {yes} test msgbox-2.34 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . yes tk_messageBox -title Hi -message "Please press yes" \ - -type yesno -default yes + -type yesno -default yes } -result {yes} test msgbox-2.35 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . no tk_messageBox -title Hi -message "Please press no" \ - -type yesno -default no + -type yesno -default no } -result {no} test msgbox-2.36 {tk_messageBox command} -constraints { nonUnixUserInteraction @@ -371,49 +371,49 @@ test msgbox-2.37 {tk_messageBox command -icon option} -constraints { } -body { ChooseMsg . yes tk_messageBox -title Hi -message "Please press yes" \ - -type yesnocancel -icon warning + -type yesnocancel -icon warning } -result {yes} test msgbox-2.38 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . yes tk_messageBox -title Hi -message "Please press yes" \ - -type yesnocancel -icon error + -type yesnocancel -icon error } -result {yes} test msgbox-2.39 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . yes tk_messageBox -title Hi -message "Please press yes" \ - -type yesnocancel -icon info + -type yesnocancel -icon info } -result {yes} test msgbox-2.40 {tk_messageBox command -icon option} -constraints { nonUnixUserInteraction } -body { ChooseMsg . yes tk_messageBox -title Hi -message "Please press yes" \ - -type yesnocancel -icon question + -type yesnocancel -icon question } -result {yes} test msgbox-2.41 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . yes tk_messageBox -title Hi -message "Please press yes" \ - -type yesnocancel -default yes + -type yesnocancel -default yes } -result {yes} test msgbox-2.42 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . no tk_messageBox -title Hi -message "Please press no" \ - -type yesnocancel -default no + -type yesnocancel -default no } -result {no} test msgbox-2.43 {tk_messageBox command} -constraints { nonUnixUserInteraction } -body { ChooseMsg . cancel tk_messageBox -title Hi -message "Please press cancel" \ - -type yesnocancel -default cancel + -type yesnocancel -default cancel } -result {cancel} diff --git a/tests/pack.test b/tests/pack.test index 0731125..db1bd88 100644 --- a/tests/pack.test +++ b/tests/pack.test @@ -594,7 +594,7 @@ test pack-6.1 {-expand option} -setup { pack .pack.a .pack.b .pack.c .pack.d -side left update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] + [winfo geometry .pack.c] [winfo geometry .pack.d] } -result {20x40+0+80 50x30+20+85 80x80+70+60 40x30+150+85} test pack-6.2 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d @@ -604,7 +604,7 @@ test pack-6.2 {-expand option} -setup { pack .pack.c .pack.d -side left -expand 1 update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] + [winfo geometry .pack.c] [winfo geometry .pack.d] } -result {20x40+18+80 50x30+56+85 80x80+124+60 40x30+241+85} test pack-6.3 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d @@ -612,7 +612,7 @@ test pack-6.3 {-expand option} -setup { pack .pack.a .pack.b .pack.c .pack.d -side top update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] + [winfo geometry .pack.c] [winfo geometry .pack.d] } -result {20x40+140+0 50x30+125+40 80x80+110+70 40x30+130+150} test pack-6.4 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d @@ -622,7 +622,7 @@ test pack-6.4 {-expand option} -setup { pack .pack.c .pack.d -side top -expand 1 update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] + [winfo geometry .pack.c] [winfo geometry .pack.d] } -result {20x40+140+3 50x30+125+46 80x80+110+79 40x30+130+166} test pack-6.5 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d @@ -630,7 +630,7 @@ test pack-6.5 {-expand option} -setup { pack .pack.a .pack.b .pack.c .pack.d -side right update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] + [winfo geometry .pack.c] [winfo geometry .pack.d] } -result {20x40+280+80 50x30+230+85 80x80+150+60 40x30+110+85} test pack-6.6 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d @@ -640,7 +640,7 @@ test pack-6.6 {-expand option} -setup { pack .pack.c .pack.d -side right -expand 1 update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] + [winfo geometry .pack.c] [winfo geometry .pack.d] } -result {20x40+262+80 50x30+194+85 80x80+95+60 40x30+18+85} test pack-6.7 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d @@ -648,7 +648,7 @@ test pack-6.7 {-expand option} -setup { pack .pack.a .pack.b .pack.c .pack.d -side bottom update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] + [winfo geometry .pack.c] [winfo geometry .pack.d] } -result {20x40+140+160 50x30+125+130 80x80+110+50 40x30+130+20} test pack-6.8 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d @@ -658,7 +658,7 @@ test pack-6.8 {-expand option} -setup { pack .pack.c .pack.d -side bottom -expand 1 update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] + [winfo geometry .pack.c] [winfo geometry .pack.d] } -result {20x40+140+157 50x30+125+124 80x80+110+40 40x30+130+3} test pack-6.9 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d @@ -669,7 +669,7 @@ test pack-6.9 {-expand option} -setup { pack .pack.d -side left update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] + [winfo geometry .pack.c] [winfo geometry .pack.d] } -result {300x65+0+135 50x30+250+52 250x105+0+0 40x30+0+105} test pack-6.10 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d @@ -680,7 +680,7 @@ test pack-6.10 {-expand option} -setup { pack .pack.d -side bottom update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] + [winfo geometry .pack.c] [winfo geometry .pack.d] } -result {100x200+0+0 50x30+175+0 160x170+140+30 40x30+100+170} test pack-6.11 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d @@ -691,16 +691,16 @@ test pack-6.11 {-expand option} -setup { pack .pack.d -side bottom -expand yes -fill both update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] + [winfo geometry .pack.c] [winfo geometry .pack.d] } -result {100x200+0+0 200x100+100+0 160x100+140+100 40x100+100+100} test pack-6.12 {-expand option} -setup { toplevel .pack2 -height 400 -width 400 wm geometry .pack2 +0+0 pack propagate .pack2 0 foreach i {w1 w2 w3} { - frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised - label .pack2.$i.l -text $i - place .pack2.$i.l -relwidth 1.0 -relheight 1.0 + frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised + label .pack2.$i.l -text $i + place .pack2.$i.l -relwidth 1.0 -relheight 1.0 } } -body { pack .pack2.w1 .pack2.w2 .pack2.w3 -padx 5 -ipadx 4 -pady 2 -ipady 6 -expand 1 -side left @@ -714,13 +714,13 @@ test pack-6.13 {-expand option} -setup { wm geometry .pack2 +0+0 pack propagate .pack2 0 foreach i {w1 w2 w3} { - frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised - label .pack2.$i.l -text $i - place .pack2.$i.l -relwidth 1.0 -relheight 1.0 + frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised + label .pack2.$i.l -text $i + place .pack2.$i.l -relwidth 1.0 -relheight 1.0 } } -body { pack .pack2.w1 .pack2.w2 .pack2.w3 -padx 5 -ipadx 4 -pady 2 \ - -ipady 6 -expand 1 -side top + -ipady 6 -expand 1 -side top update list [winfo geometry .pack2.w1] [winfo geometry .pack2.w2] [winfo geometry .pack2.w3] } -cleanup { @@ -800,29 +800,29 @@ pack .pack.a .pack.b .pack.c -side top update test pack-8.1 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] } -result {20x40+30+0 1 50x30+15+40 1 80x80+0+70 1} wm geom .pack 270x250 update test pack-8.2 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] } -result {20x40+25+0 1 50x30+10+40 1 70x30+0+70 1} wm geom .pack 240x220 update test pack-8.3 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] } -result {20x40+10+0 1 40x30+0+40 1 70x30+0+70 0} wm geom .pack 350x350 update test pack-8.4 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] } -result {20x40+65+0 1 50x30+50+40 1 80x80+35+70 1} wm geom .pack {} pack .pack.a -side left @@ -831,37 +831,37 @@ pack .pack.c -side left update test pack-8.5 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] } -result {20x40+0+20 1 50x30+100+25 1 80x80+20+0 1} wm geom .pack 320x180 update test pack-8.6 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] } -result {20x30+0+0 1 50x30+70+0 1 50x30+20+0 1} wm geom .pack 250x180 update test pack-8.7 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] } -result {20x30+0+0 1 30x30+20+0 1 50x30+20+0 0} pack forget .pack.b update test pack-8.8 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] } -result {20x30+0+0 1 30x30+20+0 0 30x30+20+0 1} pack .pack.b -side right -after .pack.a wm geom .pack {} update test pack-8.9 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] } -result {20x40+0+20 1 50x30+100+25 1 80x80+20+0 1} pack forget .pack.right .pack.bottom @@ -1176,8 +1176,8 @@ test pack-12.11 {command options and errors} -setup { test pack-12.12 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { - pack .pack.a -expand "who cares?" -} -returnCodes error -result {expected boolean value but got "who cares?"} + pack .pack.a -expand "who_cares?" +} -returnCodes error -result {expected boolean value but got "who_cares?"} test pack-12.13 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { @@ -1374,7 +1374,7 @@ test pack-13.1 {window deletion} -setup { destroy .pack.d update set result [list [pack content .pack] [winfo geometry .pack.a] \ - [winfo geometry .pack.b] [winfo geometry .pack.c]] + [winfo geometry .pack.b] [winfo geometry .pack.c]] } -result {{.pack.right .pack.bottom .pack.a .pack.b .pack.c} 20x40+30+0 50x30+15+40 80x80+0+70} test pack-14.1 {respond to changes in expansion} -setup { @@ -1460,10 +1460,10 @@ test pack-15.4 {managing geometry with -in option} -setup { destroy .pack.f1 .pack.f2 } -body { foreach i {1 2} { - frame .pack.f$i -width 100 -height 40 -bd 2 -relief raised - lower .pack.f$i - pack propagate .pack.f$i 0 - pack .pack.f$i -side top + frame .pack.f$i -width 100 -height 40 -bd 2 -relief raised + lower .pack.f$i + pack propagate .pack.f$i 0 + pack .pack.f$i -side top } pack .pack.b -in .pack.f1 -side right update @@ -1486,10 +1486,10 @@ test pack-15.5 {managing geometry with -in option} -setup { destroy .pack.f1 .pack.f2 } -body { foreach i {1 2} { - frame .pack.f$i -width 100 -height 20 -bd 2 -relief raised - lower .pack.f$i - pack propagate .pack.f$i 0 - pack .pack.f$i -side top + frame .pack.f$i -width 100 -height 20 -bd 2 -relief raised + lower .pack.f$i + pack propagate .pack.f$i 0 + pack .pack.f$i -side top } pack .pack.b -in .pack.f2 -side top update @@ -1553,6 +1553,11 @@ test pack-17.2 {PackLostContentProc procedure} -setup { # into account while the window is unmapped. # pack-18.1.2 checks that, on Windows, width/height changes are taken into # account on window remapping. +# +# While these tests pass on macOS, one can see by watching the tests +# that the window .pack is sometimes black, even though the frame is +# colored. So, evidently, even though the size changes are honored, +# the window is sometimes not completely configured. test pack-18.1.1 {unmap content when container unmapped} -constraints { macOrUnix failsOnUbuntu failsOnXQuarz } -setup { @@ -1562,7 +1567,8 @@ test pack-18.1.1 {unmap content when container unmapped} -constraints { # as the screen (screen switch causes scale and other tests to fail). wm geometry .pack +100+100 } -body { - frame .pack.a -width 100 -height 50 -relief raised -bd 2 + frame .pack.a -width 100 -height 50 -relief raised -bd 2 -bg green + after 100 pack .pack.a update set result [winfo ismapped .pack.a] @@ -1571,7 +1577,7 @@ test pack-18.1.1 {unmap content when container unmapped} -constraints { .pack.a configure -width 200 -height 75 update lappend result [winfo width .pack.a] [winfo height .pack.a] \ - [winfo ismapped .pack.a] + [winfo ismapped .pack.a] wm deiconify .pack update lappend result [winfo ismapped .pack.a] @@ -1585,7 +1591,7 @@ test pack-18.1.2 {unmap content when container unmapped} -constraints { # as the screen (screen switch causes scale and other tests to fail). wm geometry .pack +100+100 } -body { - frame .pack.a -width 100 -height 50 -relief raised -bd 2 + frame .pack.a -width 100 -height 50 -relief raised -bd 2 -bg green pack .pack.a update set result [winfo ismapped .pack.a] @@ -1606,8 +1612,8 @@ test pack-18.2 {unmap content when container unmapped} -constraints {failsOnUbun # as the screen (screen switch causes scale and other tests to fail). wm geometry .pack +100+100 } -body { - frame .pack.a -relief raised -bd 2 - frame .pack.b -width 70 -height 30 -relief sunken -bd 2 + frame .pack.a -relief raised -bd 2 -bg green + frame .pack.b -width 70 -height 30 -relief sunken -bd 2 -bg red pack .pack.a pack .pack.b -in .pack.a update @@ -1617,7 +1623,7 @@ test pack-18.2 {unmap content when container unmapped} -constraints {failsOnUbun .pack.b configure -width 100 -height 30 update lappend result [winfo width .pack.b] [winfo height .pack.b] \ - [winfo ismapped .pack.b] + [winfo ismapped .pack.b] wm deiconify .pack update lappend result [winfo ismapped .pack.b] diff --git a/tests/packgrid.test b/tests/packgrid.test index db49f60..63e5b86 100644 --- a/tests/packgrid.test +++ b/tests/packgrid.test @@ -22,7 +22,7 @@ test packgrid-1.1 {pack and grid in same container window} -setup { } -returnCodes error -cleanup { destroy .p destroy .g -} -result {cannot use geometry manager pack inside . because grid is already managing it's content windows} +} -result {cannot use geometry manager "pack" inside ".": grid is already managing its content windows} test packgrid-1.2 {pack and grid in same container window} -setup { grid propagate . true @@ -36,7 +36,7 @@ test packgrid-1.2 {pack and grid in same container window} -setup { } -returnCodes error -cleanup { destroy .p destroy .g -} -result {cannot use geometry manager grid inside . because pack is already managing it's content windows} +} -result {cannot use geometry manager "grid" inside ".": pack is already managing its content windows} test packgrid-1.3 {pack and grid in same container window} -setup { grid propagate . false @@ -137,7 +137,7 @@ test packgrid-2.1 {pack and grid in same container window, change propagation} - } -returnCodes error -cleanup { destroy .p destroy .g -} -result {cannot use geometry manager grid inside . because pack is already managing it's content windows} +} -result {cannot use geometry manager "grid" inside ".": pack is already managing its content windows} test packgrid-2.2 {pack and grid in same container window, change propagation} -setup { grid propagate . true @@ -153,7 +153,7 @@ test packgrid-2.2 {pack and grid in same container window, change propagation} - destroy .p update destroy .g -} -result {cannot use geometry manager pack inside . because grid is already managing it's content windows} +} -result {cannot use geometry manager "pack" inside ".": grid is already managing its content windows} test packgrid-2.3 {pack and grid in same container window, change propagation} -setup { grid propagate . false @@ -170,7 +170,7 @@ test packgrid-2.3 {pack and grid in same container window, change propagation} - } -returnCodes error -cleanup { destroy .p destroy .g -} -result {cannot use geometry manager pack inside . because grid is already managing it's content windows} +} -result {cannot use geometry manager "pack" inside ".": grid is already managing its content windows} test packgrid-2.4 {pack and grid in same container window, change propagation} -setup { grid propagate . false @@ -186,7 +186,7 @@ test packgrid-2.4 {pack and grid in same container window, change propagation} - } -returnCodes error -cleanup { destroy .p destroy .g -} -result {cannot use geometry manager grid inside . because pack is already managing it's content windows} +} -result {cannot use geometry manager "grid" inside ".": pack is already managing its content windows} test packgrid-3.1 {stealing content} -setup { grid propagate . true @@ -229,7 +229,7 @@ test packgrid-3.3 {stealing content} -setup { } -returnCodes error -cleanup { destroy .p destroy .g -} -result {cannot use geometry manager pack inside . because grid is already managing it's content windows} +} -result {cannot use geometry manager "pack" inside ".": grid is already managing its content windows} test packgrid-3.4 {stealing content} -setup { grid propagate . true @@ -244,7 +244,7 @@ test packgrid-3.4 {stealing content} -setup { } -returnCodes error -cleanup { destroy .p destroy .g -} -result {cannot use geometry manager grid inside . because pack is already managing it's content windows} +} -result {cannot use geometry manager "grid" inside ".": pack is already managing its content windows} test packgrid-4.1 {content stolen after container destruction - bug [aa7679685e]} -setup { frame .f diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 45c6deb..34995e1 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -49,7 +49,7 @@ test panedwindow-1.7 {configuration options: -borderwidth (good)} -body { list [lindex [.p configure -borderwidth] 4] [.p cget -borderwidth] } -cleanup { .p configure -borderwidth [lindex [.p configure -borderwidth] 3] -} -result {1 1} +} -result {1.3 1.3} test panedwindow-1.8 {configuration options: -borderwidth (bad)} -body { .p configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} @@ -148,7 +148,7 @@ test panedwindow-1.29 {configuration options: -sashpad (good)} -body { list [lindex [.p configure -sashpad] 4] [.p cget -sashpad] } -cleanup { .p configure -sashpad [lindex [.p configure -sashpad] 3] -} -result {1 1} +} -result {1.3 1.3} test panedwindow-1.30 {configuration options: -sashpad (bad)} -body { .p configure -sashpad badValue } -returnCodes error -result {expected screen distance but got "badValue"} @@ -192,7 +192,7 @@ test panedwindow-1.38 {configuration options: -width (bad)} -body { test panedwindow-1.39 {configuration options: -after (good)} -body { .p paneconfigure .b -after .c list [lindex [.p paneconfigure .b -after] 4] \ - [.p panecget .b -after] + [.p panecget .b -after] } -cleanup { .p paneconfig .b -after [lindex [.p paneconfig .b -after] 3] } -result {.c .c} @@ -202,7 +202,7 @@ test panedwindow-1.40 {configuration options: -after (bad)} -body { test panedwindow-1.41 {configuration options: -before (good)} -body { .p paneconfigure .b -before .c list [lindex [.p paneconfigure .b -before] 4] \ - [.p panecget .b -before] + [.p panecget .b -before] } -cleanup { .p paneconfig .b -before [lindex [.p paneconfig .b -before] 3] } -result {.c .c} @@ -212,7 +212,7 @@ test panedwindow-1.42 {configuration options: -before (bad)} -body { test panedwindow-1.43 {configuration options: -height (good)} -body { .p paneconfigure .b -height 10 list [lindex [.p paneconfigure .b -height] 4] \ - [.p panecget .b -height] + [.p panecget .b -height] } -cleanup { .p paneconfig .b -height [lindex [.p paneconfig .b -height] 3] } -result {10 10} @@ -222,7 +222,7 @@ test panedwindow-1.44 {configuration options: -height (bad)} -body { test panedwindow-1.45 {configuration options: -hide (good)} -body { .p paneconfigure .b -hide false list [lindex [.p paneconfigure .b -hide] 4] \ - [.p panecget .b -hide] + [.p panecget .b -hide] } -cleanup { .p paneconfig .b -hide [lindex [.p paneconfig .b -hide] 3] } -result {0 0} @@ -232,7 +232,7 @@ test panedwindow-1.46 {configuration options: -hide (bad)} -body { test panedwindow-1.47 {configuration options: -minsize (good)} -body { .p paneconfigure .b -minsize 10 list [lindex [.p paneconfigure .b -minsize] 4] \ - [.p panecget .b -minsize] + [.p panecget .b -minsize] } -cleanup { .p paneconfig .b -minsize [lindex [.p paneconfig .b -minsize] 3] } -result {10 10} @@ -242,27 +242,27 @@ test panedwindow-1.48 {configuration options: -minsize (bad)} -body { test panedwindow-1.49 {configuration options: -padx (good)} -body { .p paneconfigure .b -padx 1.3 list [lindex [.p paneconfigure .b -padx] 4] \ - [.p panecget .b -padx] + [.p panecget .b -padx] } -cleanup { .p paneconfig .b -padx [lindex [.p paneconfig .b -padx] 3] -} -result {1 1} +} -result {1.3 1.3} test panedwindow-1.50 {configuration options: -padx (bad)} -body { .p paneconfigure .b -padx badValue } -returnCodes error -result {expected screen distance but got "badValue"} test panedwindow-1.51 {configuration options: -pady (good)} -body { .p paneconfigure .b -pady 1.3 list [lindex [.p paneconfigure .b -pady] 4] \ - [.p panecget .b -pady] + [.p panecget .b -pady] } -cleanup { .p paneconfig .b -pady [lindex [.p paneconfig .b -pady] 3] -} -result {1 1} +} -result {1.3 1.3} test panedwindow-1.52 {configuration options: -pady (bad)} -body { .p paneconfigure .b -pady badValue } -returnCodes error -result {expected screen distance but got "badValue"} test panedwindow-1.53 {configuration options: -sticky (good)} -body { .p paneconfigure .b -sticky nsew list [lindex [.p paneconfigure .b -sticky] 4] \ - [.p panecget .b -sticky] + [.p panecget .b -sticky] } -cleanup { .p paneconfig .b -sticky [lindex [.p paneconfig .b -sticky] 3] } -result {nesw nesw} @@ -272,7 +272,7 @@ test panedwindow-1.54 {configuration options: -sticky (bad)} -body { test panedwindow-1.55 {configuration options: -stretch (good)} -body { .p paneconfigure .b -stretch alw list [lindex [.p paneconfigure .b -stretch] 4] \ - [.p panecget .b -stretch] + [.p panecget .b -stretch] } -cleanup { .p paneconfig .b -stretch [lindex [.p paneconfig .b -stretch] 3] } -result {always always} @@ -282,7 +282,7 @@ test panedwindow-1.56 {configuration options: -stretch (bad)} -body { test panedwindow-1.57 {configuration options: -width (good)} -body { .p paneconfigure .b -width 10 list [lindex [.p paneconfigure .b -width] 4] \ - [.p panecget .b -width] + [.p panecget .b -width] } -cleanup { .p paneconfig .b -width [lindex [.p paneconfig .b -width] 3] } -result {10 10} @@ -439,8 +439,8 @@ test panedwindow-6.4 {sash coord subcommand sashes correctly placed} -setup { } -body { panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false .p add [frame .p.f -width 20 -height 20] \ - [frame .p.f2 -width 20 -height 20] \ - [frame .p.f3 -width 20 -height 20] + [frame .p.f2 -width 20 -height 20] \ + [frame .p.f3 -width 20 -height 20] .p sash coord 0 } -cleanup { deleteWindows @@ -450,8 +450,8 @@ test panedwindow-6.5 {sash coord subcommand sashes correctly placed} -setup { } -body { panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false .p add [frame .p.f -width 20 -height 20] \ - [frame .p.f2 -width 20 -height 20] \ - [frame .p.f3 -width 20 -height 20] + [frame .p.f2 -width 20 -height 20] \ + [frame .p.f3 -width 20 -height 20] .p sash coord 1 } -cleanup { deleteWindows @@ -460,10 +460,10 @@ test panedwindow-6.6 {sash coord subcommand, sashes correctly placed} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \ - -showhandle false + -showhandle false .p add [frame .p.f -width 20 -height 20] \ - [frame .p.f2 -width 20 -height 20] \ - [frame .p.f3 -width 20 -height 20] + [frame .p.f2 -width 20 -height 20] \ + [frame .p.f3 -width 20 -height 20] .p sash coord 0 } -cleanup { deleteWindows @@ -472,10 +472,10 @@ test panedwindow-6.7 {sash coord subcommand, sashes correctly placed} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \ - -showhandle false + -showhandle false .p add [frame .p.f -width 20 -height 20] \ - [frame .p.f2 -width 20 -height 20] \ - [frame .p.f3 -width 20 -height 20] + [frame .p.f2 -width 20 -height 20] \ + [frame .p.f3 -width 20 -height 20] .p sash coord 1 } -cleanup { deleteWindows @@ -485,8 +485,8 @@ test panedwindow-6.8 {sash coord subcommand, errors} -setup { } -body { panedwindow .p list [catch {.p sash coord -1} msg] $msg \ - [catch {.p sash coord 0} msg] $msg \ - [catch {.p sash coord 1} msg] $msg + [catch {.p sash coord 0} msg] $msg \ + [catch {.p sash coord 1} msg] $msg } -cleanup { deleteWindows } -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"] @@ -497,8 +497,8 @@ test panedwindow-6.9 {sash coord subcommand, errors} -setup { panedwindow .p .p add [frame .p.f] list [catch {.p sash coord -1} msg] $msg \ - [catch {.p sash coord 0} msg] $msg \ - [catch {.p sash coord 1} msg] $msg + [catch {.p sash coord 0} msg] $msg \ + [catch {.p sash coord 1} msg] $msg } -cleanup { deleteWindows } -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"] @@ -509,9 +509,9 @@ test panedwindow-6.10 {sash coord subcommand, errors} -setup { panedwindow .p .p add [frame .p.f] [frame .p.f2] list [catch {.p sash coord -1} msg] $msg \ - [catch {.p sash coord 0} msg] \ - [catch {.p sash coord 1} msg] $msg \ - [catch {.p sash coord 2} msg] $msg + [catch {.p sash coord 0} msg] \ + [catch {.p sash coord 1} msg] $msg \ + [catch {.p sash coord 2} msg] $msg } -cleanup { deleteWindows } -result [list 1 "invalid sash index" 0 1 "invalid sash index" 1 "invalid sash index"] @@ -639,7 +639,7 @@ test panedwindow-9.2 {sash mark/sash dragto interaction} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -orient vertical \ - -showhandle false + -showhandle false .p add [frame .p.f -width 20 -height 20] [button .p.c -text foobar] .p sash mark 0 10 10 .p sash dragto 0 10 20 @@ -779,7 +779,7 @@ test panedwindow-11.4 {moving sash changes size of pane above} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ - -orient vertical + -orient vertical .p add [frame .f -width 20 -height 10] [button .c -text foobar] -sticky nsew .p sash place 0 0 20 pack .p @@ -791,7 +791,7 @@ test panedwindow-11.5 {moving sash changes size of pane below} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ - -orient vertical + -orient vertical .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10] pack .p update @@ -807,7 +807,7 @@ test panedwindow-11.6 {moving sash does not change reqsize of panedwindow} -setu deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ - -orient vertical + -orient vertical .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10] set result [winfo reqheight .p] .p sash place 0 0 20 @@ -820,7 +820,7 @@ test panedwindow-11.7 {moving sash does not alter reqsize of widget} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ - -orient vertical + -orient vertical .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10] set result [winfo reqheight .f] .p sash place 0 0 20 @@ -842,7 +842,7 @@ test panedwindow-11.9 {moving sash restricted to minsize} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ - -orient vertical + -orient vertical .p add [frame .f -width 20 -height 30] [button .c] -minsize 10 .p sash place 0 0 5 pack .p @@ -865,7 +865,7 @@ test panedwindow-11.11 {moving sash right pushes other sashes} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \ - [frame .f3 -width 20 -height 30] + [frame .f3 -width 20 -height 30] .p sash place 0 80 0 list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -876,7 +876,7 @@ test panedwindow-11.12 {moving sash left pushes other sashes} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \ - [frame .f3 -width 20 -height 30] + [frame .f3 -width 20 -height 30] .p sash place 1 0 0 list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -887,7 +887,7 @@ test panedwindow-11.13 {move sash in mapped window restricted to visible win} -s } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \ - [frame .f3 -width 20 -height 30] + [frame .f3 -width 20 -height 30] place .p -width 50 update .p sash place 1 100 0 @@ -901,7 +901,7 @@ test panedwindow-11.14 {move sash in mapped window restricted to visible win} -s } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \ - [frame .f3 -width 20 -height 30] + [frame .f3 -width 20 -height 30] place .p -width 100 update .p sash place 1 200 0 @@ -915,7 +915,7 @@ test panedwindow-11.15 {moving sash into "virtual" space on last pane increases } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \ - [frame .f3 -width 20 -height 30] + [frame .f3 -width 20 -height 30] place .p -width 100 set result [winfo reqwidth .p] update @@ -945,7 +945,7 @@ test panedwindow-12.2 {vertical panedwindow lays out widgets properly} -setup { set result {} } -body { panedwindow .p -showhandle false -borderwidth 2 -sashpad 2 -sashwidth 2 \ - -orient vertical + -orient vertical foreach win {.p.f .p.f2 .p.f3} {.p add [frame $win -width 20 -height 10]} pack .p update @@ -959,8 +959,8 @@ test panedwindow-12.3 {horizontal panedwindow lays out widgets properly} -setup } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 foreach {win color} {.p.f blue .p.f2 green} { - .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \ - -sticky "" + .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \ + -sticky "" } pack .p update @@ -978,9 +978,9 @@ test panedwindow-12.4 {vertical panedwindow lays out widgets properly} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \ - -orient vertical + -orient vertical foreach win {.p.f .p.f2} { - .p add [frame $win -width 20 -height 20] -padx 10 -pady 5 -sticky "" + .p add [frame $win -width 20 -height 20] -padx 10 -pady 5 -sticky "" } pack .p update @@ -1091,7 +1091,7 @@ test panedwindow-12.12 {vertical panedwindow reqwidth is max pane width} -setup deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ - -orient vertical + -orient vertical .p add [frame .p.f -width 20 -height 20] [frame .p.f2 -width 20 -height 20] set result [winfo reqwidth .p] .p.f config -width 40 @@ -1103,7 +1103,7 @@ test panedwindow-12.13 {vertical panedwindow reqwidth is max pane width} -setup deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ - -orient vertical + -orient vertical foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]} .p paneconfigure .p.f -width 15 set result [winfo reqwidth .p] @@ -1116,7 +1116,7 @@ test panedwindow-12.14 {panedwindow pane height overrides widget width} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \ - -orient vertical + -orient vertical foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]} .p sash place 0 0 10 pack .p @@ -1513,7 +1513,7 @@ test panedwindow-17.1 {MoveSash, move right} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -1534,7 +1534,7 @@ test panedwindow-17.2 {MoveSash, move right (unmapped) clipped by reqwidth} -set } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 100 0 @@ -1550,7 +1550,7 @@ test panedwindow-17.3 {MoveSash, move right (mapped, width < reqwidth) clipped b } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Put the panedwindow up on the display and give it a width < reqwidth @@ -1570,7 +1570,7 @@ test panedwindow-17.4 {MoveSash, move right (mapped, width > reqwidth) clipped b } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Put the panedwindow up on the display and give it a width > reqwidth @@ -1590,7 +1590,7 @@ test panedwindow-17.5 {MoveSash, move right respects minsize} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 100 0 @@ -1606,7 +1606,7 @@ test panedwindow-17.6 {MoveSash, move right respects minsize} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 100 0 @@ -1621,7 +1621,7 @@ test panedwindow-17.7 {MoveSash, move right pushes other sashes} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 100 0 @@ -1637,7 +1637,7 @@ test panedwindow-17.8 {MoveSash, move right pushes other sashes, respects minsiz } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 100 0 @@ -1653,8 +1653,8 @@ test panedwindow-17.9 {MoveSash, move right respects minsize, exludes pad} -setu } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize 10 -padx 5 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize 10 -padx 5 } .p sash place 0 100 0 @@ -1670,8 +1670,8 @@ test panedwindow-17.10 {MoveSash, move right, negative minsize becomes 0} -setup } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize -50 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize -50 } .p sash place 0 50 0 @@ -1688,7 +1688,7 @@ test panedwindow-17.11 {MoveSash, move left} -setup { set result {} panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -1709,7 +1709,7 @@ test panedwindow-17.12 {MoveSash, move left, can't move outside of window} -setu } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 -100 0 @@ -1725,7 +1725,7 @@ test panedwindow-17.13 {MoveSash, move left respects minsize} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 0 0 @@ -1741,7 +1741,7 @@ test panedwindow-17.14 {MoveSash, move left respects minsize} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 1 0 0 @@ -1756,7 +1756,7 @@ test panedwindow-17.15 {MoveSash, move left pushes other sashes} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 1 0 0 @@ -1772,7 +1772,7 @@ test panedwindow-17.16 {MoveSash, move left pushes other sashes, respects minsiz } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 1 0 0 @@ -1788,8 +1788,8 @@ test panedwindow-17.17 {MoveSash, move left respects minsize, exludes pad} -setu } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize 10 -padx 5 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize 10 -padx 5 } .p sash place 1 0 0 @@ -1805,8 +1805,8 @@ test panedwindow-17.18 {MoveSash, move left, negative minsize becomes 0} -setup } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 foreach w {.f1 .f2 .f3} c {red blue green} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize -50 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize -50 } .p sash place 1 10 0 @@ -1824,9 +1824,9 @@ test panedwindow-18.1 {MoveSash, move down} -setup { } -body { set result {} panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -1846,9 +1846,9 @@ test panedwindow-18.2 {MoveSash, move down (unmapped) clipped by reqheight} -set deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 0 100 @@ -1863,9 +1863,9 @@ test panedwindow-18.3 {MoveSash, move down (mapped, height < reqheight) clipped deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Put the panedwindow up on the display and give it a height < reqheight @@ -1884,9 +1884,9 @@ test panedwindow-18.4 {MoveSash, move down (mapped, height > reqheight) clipped deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Put the panedwindow up on the display and give it a width > reqwidth @@ -1905,9 +1905,9 @@ test panedwindow-18.5 {MoveSash, move down respects minsize} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 0 100 @@ -1922,9 +1922,9 @@ test panedwindow-18.6 {MoveSash, move down respects minsize} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 0 100 @@ -1939,9 +1939,9 @@ test panedwindow-18.7 {MoveSash, move down pushes other sashes} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 0 100 @@ -1956,9 +1956,9 @@ test panedwindow-18.8 {MoveSash, move down pushes other sashes, respects minsize deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 0 100 @@ -1973,10 +1973,10 @@ test panedwindow-18.9 {MoveSash, move down respects minsize, exludes pad} -setup deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize 10 -pady 5 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize 10 -pady 5 } .p sash place 0 0 100 @@ -1991,10 +1991,10 @@ test panedwindow-18.10 {MoveSash, move right, negative minsize becomes 0} -setup deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize -50 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize -50 } .p sash place 0 0 50 @@ -2010,9 +2010,9 @@ test panedwindow-18.11 {MoveSash, move up} -setup { } -body { set result {} panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -2032,9 +2032,9 @@ test panedwindow-18.12 {MoveSash, move up, can't move outside of window} -setup deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 0 0 -100 @@ -2049,9 +2049,9 @@ test panedwindow-18.13 {MoveSash, move up respects minsize} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 0 0 0 @@ -2066,9 +2066,9 @@ test panedwindow-18.14 {MoveSash, move up respects minsize} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 1 0 0 @@ -2082,9 +2082,9 @@ test panedwindow-18.15 {MoveSash, move up pushes other sashes} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } .p sash place 1 0 0 @@ -2099,9 +2099,9 @@ test panedwindow-18.16 {MoveSash, move up pushes other sashes, respects minsize} deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10 } .p sash place 1 0 0 @@ -2116,10 +2116,10 @@ test panedwindow-18.17 {MoveSash, move up respects minsize, exludes pad} -setup deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} c {red blue} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize 10 -pady 5 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize 10 -pady 5 } .p sash place 1 0 0 @@ -2134,10 +2134,10 @@ test panedwindow-18.18 {MoveSash, move up, negative minsize becomes 0} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} c {red blue green} { - .p add [frame $w -height 20 -width 20 -bg $c] \ - -sticky nsew -minsize -50 + .p add [frame $w -height 20 -width 20 -bg $c] \ + -sticky nsew -minsize -50 } .p sash place 1 0 10 @@ -2159,7 +2159,7 @@ test panedwindow-19.1 {ComputeGeometry, reqheight taken from widgets} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] + .p add [frame $w -width 20 -height 20 -bg blue] } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .f3 configure -height 40 @@ -2173,7 +2173,7 @@ test panedwindow-19.2 {ComputeGeometry, reqheight taken from widgets} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] + .p add [frame $w -width 20 -height 20 -bg blue] } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .p paneconfigure .f3 -height 40 @@ -2187,7 +2187,7 @@ test panedwindow-19.3 {ComputeGeometry, reqheight taken from widgets} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -pady 20 + .p add [frame $w -width 20 -height 20 -bg blue] -pady 20 } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .p paneconfigure .f3 -height 40 @@ -2200,9 +2200,9 @@ test panedwindow-19.4 {ComputeGeometry, reqwidth taken from widgets} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] + .p add [frame $w -width 20 -height 20 -bg blue] } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .f3 configure -width 40 @@ -2215,9 +2215,9 @@ test panedwindow-19.5 {ComputeGeometry, reqwidth taken from widgets} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] + .p add [frame $w -width 20 -height 20 -bg blue] } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .p paneconfigure .f3 -width 40 @@ -2230,9 +2230,9 @@ test panedwindow-19.6 {ComputeGeometry, reqwidth taken from widgets} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \ - -orient vertical + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -padx 20 + .p add [frame $w -width 20 -height 20 -bg blue] -padx 20 } set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .p paneconfigure .f3 -width 40 @@ -2248,7 +2248,7 @@ test panedwindow-19.7 {ComputeGeometry, one pane, reqsize set properly} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2259,9 +2259,9 @@ test panedwindow-19.8 {ComputeGeometry, three panes, reqsize set properly} -setu deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2272,10 +2272,10 @@ test panedwindow-19.9 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2286,17 +2286,17 @@ test panedwindow-19.10 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -2310,10 +2310,10 @@ test panedwindow-19.11 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 0 \ - -orient vertical -sashwidth 0 -handlesize 6 \ - -showhandle 0 + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 0 .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -2323,11 +2323,11 @@ test panedwindow-19.12 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2338,11 +2338,11 @@ test panedwindow-19.13 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2353,19 +2353,19 @@ test panedwindow-19.14 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -2377,7 +2377,7 @@ test panedwindow-19.15 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2388,9 +2388,9 @@ test panedwindow-19.16 {ComputeGeometry, three panes, reqsize set properly} -set deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2401,10 +2401,10 @@ test panedwindow-19.17 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2415,17 +2415,17 @@ test panedwindow-19.18 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -2439,10 +2439,10 @@ test panedwindow-19.19 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 0 \ - -orient vertical -sashwidth 0 -handlesize 6 \ - -showhandle 1 + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 1 .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -2452,11 +2452,11 @@ test panedwindow-19.20 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2467,11 +2467,11 @@ test panedwindow-19.21 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2482,19 +2482,19 @@ test panedwindow-19.22 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -2506,7 +2506,7 @@ test panedwindow-19.23 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2517,9 +2517,9 @@ test panedwindow-19.24 {ComputeGeometry, three panes, reqsize set properly} -set deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2530,10 +2530,10 @@ test panedwindow-19.25 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2544,17 +2544,17 @@ test panedwindow-19.26 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -2568,10 +2568,10 @@ test panedwindow-19.27 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 0 \ - -orient vertical -sashwidth 3 -handlesize 6 \ - -showhandle 0 + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 0 .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -2581,11 +2581,11 @@ test panedwindow-19.28 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2596,11 +2596,11 @@ test panedwindow-19.29 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2611,19 +2611,19 @@ test panedwindow-19.30 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -2635,7 +2635,7 @@ test panedwindow-19.31 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2646,9 +2646,9 @@ test panedwindow-19.32 {ComputeGeometry, three panes, reqsize set properly} -set deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2659,10 +2659,10 @@ test panedwindow-19.33 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2673,17 +2673,17 @@ test panedwindow-19.34 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -2697,10 +2697,10 @@ test panedwindow-19.35 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 0 \ - -orient vertical -sashwidth 3 -handlesize 6 \ - -showhandle 1 + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 1 .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -2710,11 +2710,11 @@ test panedwindow-19.36 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2725,11 +2725,11 @@ test panedwindow-19.37 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2740,19 +2740,19 @@ test panedwindow-19.38 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -2764,7 +2764,7 @@ test panedwindow-19.39 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2775,9 +2775,9 @@ test panedwindow-19.40 {ComputeGeometry, three panes, reqsize set properly} -set deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2788,10 +2788,10 @@ test panedwindow-19.41 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2802,17 +2802,17 @@ test panedwindow-19.42 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -2826,10 +2826,10 @@ test panedwindow-19.43 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 5 \ - -orient vertical -sashwidth 0 -handlesize 6 \ - -showhandle 0 + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 0 .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -2839,11 +2839,11 @@ test panedwindow-19.44 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2854,11 +2854,11 @@ test panedwindow-19.45 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2869,19 +2869,19 @@ test panedwindow-19.46 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -2893,7 +2893,7 @@ test panedwindow-19.47 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2904,9 +2904,9 @@ test panedwindow-19.48 {ComputeGeometry, three panes, reqsize set properly} -set deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2917,10 +2917,10 @@ test panedwindow-19.49 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2931,17 +2931,17 @@ test panedwindow-19.50 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -2955,10 +2955,10 @@ test panedwindow-19.51 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 5 \ - -orient vertical -sashwidth 0 -handlesize 6 \ - -showhandle 1 + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 1 .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -2968,11 +2968,11 @@ test panedwindow-19.52 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -2983,11 +2983,11 @@ test panedwindow-19.53 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -2998,19 +2998,19 @@ test panedwindow-19.54 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -3022,7 +3022,7 @@ test panedwindow-19.55 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3033,9 +3033,9 @@ test panedwindow-19.56 {ComputeGeometry, three panes, reqsize set properly} -set deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3046,10 +3046,10 @@ test panedwindow-19.57 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3060,17 +3060,17 @@ test panedwindow-19.58 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -3084,10 +3084,10 @@ test panedwindow-19.59 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 5 \ - -orient vertical -sashwidth 3 -handlesize 6 \ - -showhandle 0 + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 0 .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -3097,11 +3097,11 @@ test panedwindow-19.60 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3112,11 +3112,11 @@ test panedwindow-19.61 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3127,19 +3127,19 @@ test panedwindow-19.62 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -3151,7 +3151,7 @@ test panedwindow-19.63 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3162,9 +3162,9 @@ test panedwindow-19.64 {ComputeGeometry, three panes, reqsize set properly} -set deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3175,10 +3175,10 @@ test panedwindow-19.65 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3189,17 +3189,17 @@ test panedwindow-19.66 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -3213,10 +3213,10 @@ test panedwindow-19.67 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 0 -sashpad 5 \ - -orient vertical -sashwidth 3 -handlesize 6 \ - -showhandle 1 + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 1 .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -3226,11 +3226,11 @@ test panedwindow-19.68 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3241,11 +3241,11 @@ test panedwindow-19.69 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3256,19 +3256,19 @@ test panedwindow-19.70 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 0 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -3280,7 +3280,7 @@ test panedwindow-19.71 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3291,9 +3291,9 @@ test panedwindow-19.72 {ComputeGeometry, three panes, reqsize set properly} -set deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3304,10 +3304,10 @@ test panedwindow-19.73 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3318,17 +3318,17 @@ test panedwindow-19.74 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -3342,10 +3342,10 @@ test panedwindow-19.75 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 0 \ - -orient vertical -sashwidth 0 -handlesize 6 \ - -showhandle 0 + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 0 .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -3355,11 +3355,11 @@ test panedwindow-19.76 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3370,11 +3370,11 @@ test panedwindow-19.77 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3385,19 +3385,19 @@ test panedwindow-19.78 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -3409,7 +3409,7 @@ test panedwindow-19.79 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3420,9 +3420,9 @@ test panedwindow-19.80 {ComputeGeometry, three panes, reqsize set properly} -set deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3433,10 +3433,10 @@ test panedwindow-19.81 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3447,17 +3447,17 @@ test panedwindow-19.82 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -3471,10 +3471,10 @@ test panedwindow-19.83 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 0 \ - -orient vertical -sashwidth 0 -handlesize 6 \ - -showhandle 1 + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 1 .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -3484,11 +3484,11 @@ test panedwindow-19.84 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3499,11 +3499,11 @@ test panedwindow-19.85 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3514,19 +3514,19 @@ test panedwindow-19.86 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -3538,7 +3538,7 @@ test panedwindow-19.87 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3549,9 +3549,9 @@ test panedwindow-19.88 {ComputeGeometry, three panes, reqsize set properly} -set deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3562,10 +3562,10 @@ test panedwindow-19.89 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3576,17 +3576,17 @@ test panedwindow-19.90 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -3600,10 +3600,10 @@ test panedwindow-19.91 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 0 \ - -orient vertical -sashwidth 3 -handlesize 6 \ - -showhandle 0 + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 0 .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -3613,11 +3613,11 @@ test panedwindow-19.92 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3628,11 +3628,11 @@ test panedwindow-19.93 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3643,19 +3643,19 @@ test panedwindow-19.94 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -3667,7 +3667,7 @@ test panedwindow-19.95 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3678,9 +3678,9 @@ test panedwindow-19.96 {ComputeGeometry, three panes, reqsize set properly} -set deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3691,10 +3691,10 @@ test panedwindow-19.97 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3705,17 +3705,17 @@ test panedwindow-19.98 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -3729,10 +3729,10 @@ test panedwindow-19.99 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 0 \ - -orient vertical -sashwidth 3 -handlesize 6 \ - -showhandle 1 + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 1 .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -3742,11 +3742,11 @@ test panedwindow-19.100 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3757,11 +3757,11 @@ test panedwindow-19.101 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3772,19 +3772,19 @@ test panedwindow-19.102 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 0 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -3796,7 +3796,7 @@ test panedwindow-19.103 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3807,9 +3807,9 @@ test panedwindow-19.104 {ComputeGeometry, three panes, reqsize set properly} -se deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3820,10 +3820,10 @@ test panedwindow-19.105 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3834,17 +3834,17 @@ test panedwindow-19.106 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 + -sashwidth 0 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -3858,10 +3858,10 @@ test panedwindow-19.107 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 5 \ - -orient vertical -sashwidth 0 -handlesize 6 \ - -showhandle 0 + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 0 .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -3871,11 +3871,11 @@ test panedwindow-19.108 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3886,11 +3886,11 @@ test panedwindow-19.109 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3901,19 +3901,19 @@ test panedwindow-19.110 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -3925,7 +3925,7 @@ test panedwindow-19.111 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3936,9 +3936,9 @@ test panedwindow-19.112 {ComputeGeometry, three panes, reqsize set properly} -se deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -3949,10 +3949,10 @@ test panedwindow-19.113 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -3963,17 +3963,17 @@ test panedwindow-19.114 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 + -sashwidth 0 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -3987,10 +3987,10 @@ test panedwindow-19.115 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 5 \ - -orient vertical -sashwidth 0 -handlesize 6 \ - -showhandle 1 + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 1 .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -4000,11 +4000,11 @@ test panedwindow-19.116 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -4015,11 +4015,11 @@ test panedwindow-19.117 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -4030,19 +4030,19 @@ test panedwindow-19.118 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 0 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -4054,7 +4054,7 @@ test panedwindow-19.119 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -4065,9 +4065,9 @@ test panedwindow-19.120 {ComputeGeometry, three panes, reqsize set properly} -se deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -4078,10 +4078,10 @@ test panedwindow-19.121 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -4092,17 +4092,17 @@ test panedwindow-19.122 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 + -sashwidth 3 -handlesize 6 -showhandle 0 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -4116,10 +4116,10 @@ test panedwindow-19.123 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 5 \ - -orient vertical -sashwidth 3 -handlesize 6 \ - -showhandle 0 + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 0 .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -4129,11 +4129,11 @@ test panedwindow-19.124 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -4144,11 +4144,11 @@ test panedwindow-19.125 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -4159,19 +4159,19 @@ test panedwindow-19.126 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 0 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -4183,7 +4183,7 @@ test panedwindow-19.127 {ComputeGeometry, one pane, reqsize set properly} -setup # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -4194,9 +4194,9 @@ test panedwindow-19.128 {ComputeGeometry, three panes, reqsize set properly} -se deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -4207,10 +4207,10 @@ test panedwindow-19.129 {ComputeGeometry, sash coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -4221,17 +4221,17 @@ test panedwindow-19.130 {ComputeGeometry/ArrangePanes, pane coords} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 + -sashwidth 3 -handlesize 6 -showhandle 1 foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 3 -padx 11 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] } return $result } -cleanup { @@ -4245,10 +4245,10 @@ test panedwindow-19.131 {ComputeGeometry, one pane, vertical} -setup { # affect the panedwindow's geometry, since no sash should # ever be drawn. panedwindow .p -borderwidth 2 -sashpad 5 \ - -orient vertical -sashwidth 3 -handlesize 6 \ - -showhandle 1 + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 1 .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ - -sticky "" + -sticky "" list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { deleteWindows @@ -4258,11 +4258,11 @@ test panedwindow-19.132 {ComputeGeometry, three panes, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [winfo reqwidth .p] [winfo reqheight .p] } -cleanup { @@ -4273,11 +4273,11 @@ test panedwindow-19.133 {ComputeGeometry, sash coords, vertical} -setup { deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.f1 .f2 .f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky "" + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" } list [.p sash coord 0] [.p sash coord 1] } -cleanup { @@ -4288,19 +4288,19 @@ test panedwindow-19.134 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup deleteWindows } -body { panedwindow .p -borderwidth 2 -sashpad 5 \ - -sashwidth 3 -handlesize 6 -showhandle 1 \ - -orient vertical + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical foreach w {.p.f1 .p.f2 .p.f3} { - .p add [frame $w -width 20 -height 20 -bg blue] \ - -sticky nsew -pady 11 -padx 3 + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 } pack .p update set result {} foreach w {.p.f1 .p.f2 .p.f3} { - lappend result [list [winfo x $w] [winfo y $w] \ - [winfo width $w] [winfo height $w]] - } + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } return $result } -cleanup { deleteWindows @@ -4322,7 +4322,7 @@ test panedwindow-20.2 {destroyed pane causes geometry recomputation} -setup { } -body { panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] + [frame .f2 -width 20 -height 20 -bg red] destroy .f winfo reqwidth .p } -cleanup { @@ -4335,7 +4335,7 @@ test panedwindow-21.1 {ArrangePanes, extra space is given to the last pane} -set } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] -sticky nsew + [frame .f2 -width 20 -height 20 -bg red] -sticky nsew place .p -width 100 -x 0 -y 0 update winfo width .f2 @@ -4346,9 +4346,9 @@ test panedwindow-21.2 {ArrangePanes, extra space is given to the last pane} -set deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] -sticky nsew + [frame .f2 -width 20 -height 20 -bg red] -sticky nsew place .p -height 100 -x 0 -y 0 update winfo height .f2 @@ -4360,7 +4360,7 @@ test panedwindow-21.3 {ArrangePanes, explicit height/width are preferred} -setup } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] -sticky "" + [frame .f2 -width 20 -height 20 -bg red] -sticky "" .p paneconfigure .f1 -width 10 -height 15 pack .p update @@ -4373,7 +4373,7 @@ test panedwindow-21.4 {ArrangePanes, panes clipped by size of pane} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] + [frame .f2 -width 20 -height 20 -bg red] .p sash place 0 10 0 pack .p update @@ -4385,9 +4385,9 @@ test panedwindow-21.5 {ArrangePanes, panes clipped by size of pane} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] + [frame .f2 -width 20 -height 20 -bg red] .p sash place 0 0 10 pack .p update @@ -4400,7 +4400,7 @@ test panedwindow-21.6 {ArrangePanes, height of pane taken from total height} -se } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .p.f1 -width 20 -height 20 -bg blue] \ - [frame .p.f2 -width 20 -height 40 -bg red] -sticky "" + [frame .p.f2 -width 20 -height 40 -bg red] -sticky "" pack .p update winfo y .p.f1 @@ -4411,9 +4411,9 @@ test panedwindow-21.7 {ArrangePanes, width of pane taken from total width} -setu deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical .p add [frame .p.f1 -width 20 -height 20 -bg blue] \ - [frame .p.f2 -width 40 -height 40 -bg red] -sticky "" + [frame .p.f2 -width 40 -height 40 -bg red] -sticky "" pack .p update winfo x .p.f1 @@ -4425,7 +4425,7 @@ test panedwindow-21.8 {ArrangePanes, panes with width <= 0 are unmapped} -setup } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 40 -bg red] + [frame .f2 -width 20 -height 40 -bg red] pack .p update set result [winfo ismapped .f1] @@ -4440,7 +4440,7 @@ test panedwindow-21.9 {ArrangePanes, panes with width <= 0 are unmapped} -setup } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .p.f1 -width 20 -height 20 -bg blue] \ - [frame .p.f2 -width 20 -height 40 -bg red] + [frame .p.f2 -width 20 -height 40 -bg red] pack .p update set result [winfo ismapped .p.f1] @@ -4455,7 +4455,7 @@ test panedwindow-21.10 {ArrangePanes, panes with width <= 0 are unmapped} -setup } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 -orient vertical .p add [frame .p.f1 -width 20 -height 20 -bg blue] \ - [frame .p.f2 -width 20 -height 40 -bg red] + [frame .p.f2 -width 20 -height 40 -bg red] pack .p update set result [winfo ismapped .p.f1] @@ -4470,7 +4470,7 @@ test panedwindow-21.11 {ArrangePanes, last pane shrinks} -setup { } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] -sticky nsew + [frame .f2 -width 20 -height 20 -bg red] -sticky nsew place .p -width 40 -x 0 -y 0 update winfo width .f2 @@ -4481,9 +4481,9 @@ test panedwindow-21.12 {ArrangePanes, last pane shrinks} -setup { deleteWindows } -body { panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \ - -orient vertical + -orient vertical .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 20 -bg red] -sticky nsew + [frame .f2 -width 20 -height 20 -bg red] -sticky nsew place .p -height 40 -x 0 -y 0 update winfo height .f2 @@ -4521,17 +4521,17 @@ test panedwindow-21.15 {ArrangePanes, last pane grows} -setup { } -body { panedwindow .p -showhandle false -height 50 .p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \ - [frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green] + [frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green] .p sash place 1 250 0 pack .p update set result [list] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] + [winfo width .f4] [winfo width .p] .p configure -width 300 update lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] + [winfo width .f4] [winfo width .p] } -cleanup { deleteWindows } -result {50 150 1 1 211 50 150 1 89 300} @@ -4543,7 +4543,7 @@ test panedwindow-22.1 {PanedWindowReqProc, react to pane geometry changes} -setu # Basically just want to make sure that the PanedWindowReqProc is called panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2 .p add [frame .f1 -width 20 -height 20 -bg blue] \ - [frame .f2 -width 20 -height 40 -bg red] + [frame .f2 -width 20 -height 40 -bg red] set result [winfo reqheight .p] .f1 configure -height 80 lappend result [winfo reqheight .p] @@ -4572,7 +4572,7 @@ test panedwindow-23.1 {ConfigurePanes, can't add panedwindow to itself} -setup { .p add .p } -cleanup { deleteWindows -} -returnCodes error -result {can't add .p to itself} +} -returnCodes error -result {cannot add .p to itself} test panedwindow-23.2 {ConfigurePanes, bad window throws error} -setup { deleteWindows } -body { @@ -4657,11 +4657,11 @@ test panedwindow-23.10 {ConfigurePanes, options applied to all panes} -setup { .p add [button .b] [button .c] -sticky ne -height 5 -width 5 -minsize 10 set result {} foreach w {.b .c} { - set val {} - foreach option {-sticky -height -width -minsize} { - lappend val $option [.p panecget $w $option] - } - lappend result $w $val + set val {} + foreach option {-sticky -height -width -minsize} { + lappend val $option [.p panecget $w $option] + } + lappend result $w $val } return $result } -cleanup { @@ -4675,7 +4675,7 @@ test panedwindow-23.11 {ConfigurePanes, existing panes are reconfigured} -setup .p add [button .b] -sticky nw -height 10 .p add .b [button .c] -sticky se -height 2 list [.p panes] [.p panecget .b -sticky] [.p panecget .b -height] \ - [.p panecget .c -sticky] [.p panecget .c -height] + [.p panecget .c -sticky] [.p panecget .c -height] } -cleanup { deleteWindows } -result [list {.b .c} es 2 es 2] @@ -4863,7 +4863,7 @@ test panedwindow-23.24 {ConfigurePanes, panedwindow cannot manage toplevels} -se .p add .t } -cleanup { deleteWindows -} -returnCodes error -result {can't add toplevel .t to .p} +} -returnCodes error -result {cannot add toplevel .t to .p} test panedwindow-23.25 {ConfigurePanes, restrict possible panes} -setup { deleteWindows } -body { @@ -4873,7 +4873,7 @@ test panedwindow-23.25 {ConfigurePanes, restrict possible panes} -setup { .p add .f.b } -cleanup { deleteWindows -} -returnCodes error -result {can't add .f.b to .p} +} -returnCodes error -result {cannot add .f.b to .p} test panedwindow-23.26 {ConfigurePanes, restrict possible panes} -setup { deleteWindows } -body { @@ -4918,15 +4918,15 @@ test panedwindow-23.29 {ConfigurePanes, -hide works} -setup { update set result [list] lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ - [winfo ismapped .f3] [winfo ismapped .f4] + [winfo ismapped .f3] [winfo ismapped .f4] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] + [winfo width .f4] [winfo width .p] .p paneconfigure .f2 -hide 1 update lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ - [winfo ismapped .f3] [winfo ismapped .f4] + [winfo ismapped .f3] [winfo ismapped .f4] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] + [winfo width .f4] [winfo width .p] } -cleanup { deleteWindows } -result {1 1 1 1 40 40 40 40 171 1 0 1 1 40 40 40 40 128} @@ -4943,15 +4943,15 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { update set result [list] lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ - [winfo ismapped .f3] [winfo ismapped .f4] + [winfo ismapped .f3] [winfo ismapped .f4] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] + [winfo width .f4] [winfo width .p] .p paneconfigure .f2 -hide 1 update lappend result [winfo ismapped .f1] [winfo ismapped .f2] \ - [winfo ismapped .f3] [winfo ismapped .f4] + [winfo ismapped .f3] [winfo ismapped .f4] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] [winfo width .p] + [winfo width .f4] [winfo width .p] } -cleanup { deleteWindows } -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130} @@ -4971,19 +4971,19 @@ test panedwindow-23.30a {ConfigurePanes, hidden panes are unmapped} -setup { update set result [list] lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ - [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] .p2 paneconfigure .l1 -hide 1 update lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ - [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] .p1 paneconfigure .p2 -hide 1 update lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ - [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] .p1 paneconfigure .p2 -hide 0 update lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ - [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] } -cleanup { deleteWindows } -result {{1 1 1 1 1} {1 1 0 1 1} {1 0 0 0 0} {1 1 0 1 1}} @@ -5009,7 +5009,7 @@ test panedwindow-23.32 {ConfigurePanes, -hide works, last pane stretches} -setup deleteWindows } -body { panedwindow .p -showhandle false -width 200 -height 200 \ - -borderwidth 0 -orient vertical + -borderwidth 0 -orient vertical frame .f1 -height 50 -bg red frame .f2 -height 50 -bg green frame .f3 -height 50 -bg blue @@ -5038,11 +5038,11 @@ test panedwindow-23.33 {ConfigurePanes, -stretch first} -setup { update set result [list] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + [winfo width .f4] .p paneconfigure .f2 -hide 1 update lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + [winfo width .f4] } -cleanup { deleteWindows } -result {51 40 40 40 94 40 40 40} @@ -5059,11 +5059,11 @@ test panedwindow-23.34 {ConfigurePanes, -stretch middle} -setup { update set result [list] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + [winfo width .f4] .p paneconfigure .f2 -hide 1 update lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + [winfo width .f4] } -cleanup { deleteWindows } -result {40 45 46 40 40 45 94 40} @@ -5080,11 +5080,11 @@ test panedwindow-23.35 {ConfigurePanes, -stretch always} -setup { update set result [list] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + [winfo width .f4] .p paneconfigure .f2 -hide 1 update lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + [winfo width .f4] } -cleanup { deleteWindows } -result {42 43 43 43 58 43 58 58} @@ -5101,11 +5101,11 @@ test panedwindow-23.36 {ConfigurePanes, -stretch never} -setup { update set result [list] lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + [winfo width .f4] .p paneconfigure .f2 -hide 1 update lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ - [winfo width .f4] + [winfo width .f4] } -cleanup { deleteWindows } -result {40 40 40 40 40 40 40 40} @@ -5139,10 +5139,10 @@ test panedwindow-25.1 {DestroyPanedWindow} -setup { # This test should not result in any memory leaks. panedwindow .p foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .q .r .s .t} { - .p add [button $w] + .p add [button $w] } foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .p .q .r .s .t} { - destroy $w + destroy $w } set result {} } -result {} @@ -5174,7 +5174,7 @@ test panedwindow-26.1 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 0 } -cleanup { deleteWindows @@ -5184,7 +5184,7 @@ test panedwindow-26.2 {PanedWindowIdentifyCoords, padding is included} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 20 0 } -cleanup { deleteWindows @@ -5194,7 +5194,7 @@ test panedwindow-26.3 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 22 0 } -cleanup { deleteWindows @@ -5204,7 +5204,7 @@ test panedwindow-26.4 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 24 0 } -cleanup { deleteWindows @@ -5214,7 +5214,7 @@ test panedwindow-26.5 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 26 0 } -cleanup { deleteWindows @@ -5224,7 +5224,7 @@ test panedwindow-26.6 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 26 -1 } -cleanup { deleteWindows @@ -5234,7 +5234,7 @@ test panedwindow-26.7 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 26 100 } -cleanup { deleteWindows @@ -5243,9 +5243,9 @@ test panedwindow-26.8 {PanedWindowIdentifyCoords} -setup { deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 6 + -handlesize 6 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 22 4 } -cleanup { deleteWindows @@ -5254,9 +5254,9 @@ test panedwindow-26.9 {PanedWindowIdentifyCoords} -setup { deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 6 + -handlesize 6 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 22 5 } -cleanup { deleteWindows @@ -5265,9 +5265,9 @@ test panedwindow-26.10 {PanedWindowIdentifyCoords} -setup { deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 8 + -handlesize 8 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 20 5 } -cleanup { deleteWindows @@ -5276,9 +5276,9 @@ test panedwindow-26.11 {PanedWindowIdentifyCoords} -setup { deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 8 + -handlesize 8 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 20 0 } -cleanup { deleteWindows @@ -5288,8 +5288,8 @@ test panedwindow-26.12 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2 .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] \ - [frame .f3 -bg green -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] \ + [frame .f3 -bg green -width 20 -height 20] .p identify 48 0 } -cleanup { deleteWindows @@ -5323,7 +5323,7 @@ test panedwindow-26.16 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 0 } -cleanup { deleteWindows @@ -5333,7 +5333,7 @@ test panedwindow-26.17 {PanedWindowIdentifyCoords, padding is included} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 20 } -cleanup { deleteWindows @@ -5343,7 +5343,7 @@ test panedwindow-26.18 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 22 } -cleanup { deleteWindows @@ -5353,7 +5353,7 @@ test panedwindow-26.19 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 24 } -cleanup { deleteWindows @@ -5363,7 +5363,7 @@ test panedwindow-26.20 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 26 } -cleanup { deleteWindows @@ -5373,7 +5373,7 @@ test panedwindow-26.21 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify -1 26 } -cleanup { deleteWindows @@ -5383,7 +5383,7 @@ test panedwindow-26.22 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 100 26 } -cleanup { deleteWindows @@ -5392,9 +5392,9 @@ test panedwindow-26.23 {PanedWindowIdentifyCoords} -setup { deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 6 -orient vertical + -handlesize 6 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 4 22 } -cleanup { deleteWindows @@ -5403,9 +5403,9 @@ test panedwindow-26.24 {PanedWindowIdentifyCoords} -setup { deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 6 -orient vertical + -handlesize 6 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 5 22 } -cleanup { deleteWindows @@ -5414,9 +5414,9 @@ test panedwindow-26.25 {PanedWindowIdentifyCoords} -setup { deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 8 -orient vertical + -handlesize 8 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 5 20 } -cleanup { deleteWindows @@ -5425,9 +5425,9 @@ test panedwindow-26.26 {PanedWindowIdentifyCoords} -setup { deleteWindows } -body { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \ - -handlesize 8 -orient vertical + -handlesize 8 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] .p identify 0 20 } -cleanup { deleteWindows @@ -5437,8 +5437,8 @@ test panedwindow-26.27 {PanedWindowIdentifyCoords} -setup { } -body { panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2 -orient vertical .p add [frame .f -bg red -width 20 -height 20] \ - [frame .f2 -bg blue -width 20 -height 20] \ - [frame .f3 -bg green -width 20 -height 20] + [frame .f2 -bg blue -width 20 -height 20] \ + [frame .f3 -bg green -width 20 -height 20] .p identify 0 48 } -cleanup { deleteWindows diff --git a/tests/place.test b/tests/place.test index fae275a..7fdcc2a 100644 --- a/tests/place.test +++ b/tests/place.test @@ -37,8 +37,8 @@ test place-1.2 {Tk_PlaceCmd procedure, "info" option} -setup { place forget .t.f2 } -body { place .t.f2 -x 1 -y 2 -width 3 -height 4 -relx 0.1 -rely 0.2 \ - -relwidth 0.3 -relheight 0.4 -anchor se -in .t.f \ - -bordermode outside + -relwidth 0.3 -relheight 0.4 -anchor se -in .t.f \ + -bordermode outside place info .t.f2 } -result {-in .t.f -x 1 -relx 0.1 -y 2 -rely 0.2 -width 3 -relwidth 0.3 -height 4 -relheight 0.4 -anchor se -bordermode outside} test place-1.3 {Tk_PlaceCmd procedure, "info" option} -setup { @@ -48,8 +48,8 @@ test place-1.3 {Tk_PlaceCmd procedure, "info" option} -setup { # Make sure the result is built as a proper list by using a space in parent frame ".t.a b" place .t.f2 -x 1 -y 2 -width {} -height 4 -relx 0.2 -rely 0.2 \ - -relwidth 0.3 -relheight {} -anchor w -in ".t.a b" \ - -bordermode ignore + -relwidth 0.3 -relheight {} -anchor w -in ".t.a b" \ + -bordermode ignore place info .t.f2 } -cleanup { destroy ".t.a.b" @@ -485,22 +485,22 @@ test place-13.1 {test respect for internalborder} -setup { test place-14.1 {memory leak testing} -constraints memory -setup { destroy .f proc getbytes {} { - set lines [split [memory info] "\n"] - lindex [lindex $lines 3] 3 + set lines [split [memory info] "\n"] + lindex [lindex $lines 3] 3 } # Repeat each body checking that memory does not increase proc stress {args} { - set res {} - foreach body $args { - set end 0 - for {set i 0} {$i < 5} {incr i} { - uplevel 1 $body - set tmp $end - set end [getbytes] - } - lappend res [expr {$end - $tmp}] - } - return $res + set res {} + foreach body $args { + set end 0 + for {set i 0} {$i < 5} {incr i} { + uplevel 1 $body + set tmp $end + set end [getbytes] + } + lappend res [expr {$end - $tmp}] + } + return $res } } -body { # Test all manners of forgetting content diff --git a/tests/raise.test b/tests/raise.test index 2e9e2c6..7e6b0bd 100644 --- a/tests/raise.test +++ b/tests/raise.test @@ -16,6 +16,7 @@ namespace import -force tcltest::test # Procedure to create a bunch of overlapping windows, which should # make it easy to detect differences in order. +wm geometry . +400+400 proc raise_setup {} { destroy {*}[winfo children .raise] update idletasks diff --git a/tests/safe.test b/tests/safe.test index 9bb1a36..03d298e 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -40,7 +40,7 @@ if {[package vsatisfies [package provide Tcl] 8.6.7-]} { lappend hidden_cmds tcl:encoding:dirs } if {[package vsatisfies [package provide Tcl] 8.7-]} { - lappend hidden_cmds file tcl:encoding:system tcl:file:tempdir tcl:file:home tcl:file:tildeexpand + lappend hidden_cmds file tcl:encoding:system tcl:file:tempdir tcl:file:home tcl:file:tildeexpand zipfs foreach cmd { cmdtype nameofexecutable } {lappend hidden_cmds tcl:info:$cmd} @@ -48,7 +48,7 @@ if {[package vsatisfies [package provide Tcl] 8.7-]} { autopurge list purge status } {lappend hidden_cmds tcl:process:$cmd} foreach cmd { - lmkimg lmkzip mkimg mkkey mkzip mount mount_data unmount + canonical exists info list lmkimg lmkzip mkimg mkkey mkzip mount mountdata root unmount } {lappend hidden_cmds tcl:zipfs:$cmd} } foreach cmd { diff --git a/tests/safePrimarySelection.test b/tests/safePrimarySelection.test index fd237f0..4605735 100644 --- a/tests/safePrimarySelection.test +++ b/tests/safePrimarySelection.test @@ -67,20 +67,20 @@ set ::_test_tmp::script { namespace eval ::_test_tmp {} proc ::_test_tmp::getPrimarySelection {} { - if {[catch {::tk::GetSelection . PRIMARY} sel]} { - set sel {} - } - return $sel + if {[catch {::tk::GetSelection . PRIMARY} sel]} { + set sel {} + } + return $sel } proc ::_test_tmp::setPrimarySelection {} { - destroy .preset - text .preset -exportselection 1 - .preset insert end OLD_VALUE - # pack .preset - .preset tag add sel 1.0 end-1c - update - return + destroy .preset + text .preset -exportselection 1 + .preset insert end OLD_VALUE + # pack .preset + .preset tag add sel 1.0 end-1c + update + return } # Clearing the PRIMARY selection is troublesome. @@ -88,123 +88,123 @@ set ::_test_tmp::script { # However, the window must continue to exist, or some X11 servers # will set the PRIMARY selection to something else. proc ::_test_tmp::clearPrimarySelection {} { - destroy .clear - text .clear -exportselection 1 - .clear insert end TMP_VALUE - # pack .clear - .clear tag add sel 1.0 end-1c - update - .clear tag remove sel 1.0 end-1c - update - return + destroy .clear + text .clear -exportselection 1 + .clear insert end TMP_VALUE + # pack .clear + .clear tag add sel 1.0 end-1c + update + .clear tag remove sel 1.0 end-1c + update + return } # If this interpreter can write to the PRIMARY # selection, the commands below will do so. proc ::_test_tmp::tryText {} { - text .t -exportselection 1 - .t insert end PAYLOAD - pack .t - .t tag add sel 1.0 end-1c - update - return + text .t -exportselection 1 + .t insert end PAYLOAD + pack .t + .t tag add sel 1.0 end-1c + update + return } proc ::_test_tmp::tryEntry {} { - entry .t -exportselection 1 - .t insert end PAYLOAD - pack .t - .t selection range 0 end - update - return + entry .t -exportselection 1 + .t insert end PAYLOAD + pack .t + .t selection range 0 end + update + return } proc ::_test_tmp::tryTtkEntry {} { - ::ttk::entry .t -exportselection 1 - .t insert end PAYLOAD - pack .t - .t selection range 0 end - update - return + ::ttk::entry .t -exportselection 1 + .t insert end PAYLOAD + pack .t + .t selection range 0 end + update + return } proc ::_test_tmp::tryListbox {} { - listbox .t -exportselection 1 - .t insert end list1 PAYLOAD list3 - pack .t - .t selection set 1 - update - return + listbox .t -exportselection 1 + .t insert end list1 PAYLOAD list3 + pack .t + .t selection set 1 + update + return } proc ::_test_tmp::trySpinbox {ver} { - if {$ver == 1} { - # spinbox as entry - spinbox .t -exportselection 1 -values {1 2 3 4 5} - .t delete 0 end - .t insert end PAYLOAD - pack .t - .t selection range 0 end - update - return - # selects PAYLOAD - } elseif {$ver == 2} { - # spinbox spun - spinbox .t -exportselection 1 -values {1 2 3 4 5} - .t invoke buttonup - pack .t - .t selection range 0 end - update - return - # selects 2 - } else { - # spinbox spun/selected/spun - spinbox .t -exportselection 1 -values {1 2 3 4 5} - .t invoke buttonup - pack .t - .t selection range 0 end - update - .t invoke buttonup - update - return - # selects 3 - } + if {$ver == 1} { + # spinbox as entry + spinbox .t -exportselection 1 -values {1 2 3 4 5} + .t delete 0 end + .t insert end PAYLOAD + pack .t + .t selection range 0 end + update + return + # selects PAYLOAD + } elseif {$ver == 2} { + # spinbox spun + spinbox .t -exportselection 1 -values {1 2 3 4 5} + .t invoke buttonup + pack .t + .t selection range 0 end + update + return + # selects 2 + } else { + # spinbox spun/selected/spun + spinbox .t -exportselection 1 -values {1 2 3 4 5} + .t invoke buttonup + pack .t + .t selection range 0 end + update + .t invoke buttonup + update + return + # selects 3 + } } proc ::_test_tmp::tryTtkSpinbox {ver} { - if {$ver == 1} { - # ttk::spinbox as entry - ::ttk::spinbox .t -exportselection 1 -values {1 2 3 4 5} - .t delete 0 end - .t insert end PAYLOAD - pack .t - .t selection range 0 end - update - return - } elseif {$ver == 2} { - # ttk::spinbox spun - ::ttk::spinbox .t -exportselection 1 -values {1 2 3 4 5} - ::ttk::spinbox::Spin .t +1 - ::ttk::spinbox::Spin .t +1 - pack .t - # ttk::spinbox::Spin sets selection - update - return - # selects 2 - } else { - # ttk::spinbox spun/selected/spun - ::ttk::spinbox .t -exportselection 1 -values {1 2 3 4 5} - ::ttk::spinbox::Spin .t +1 - ::ttk::spinbox::Spin .t +1 - pack .t - # ttk::spinbox::Spin sets selection - update - ::ttk::spinbox::Spin .t +1 - update - return - # selects 3 - } + if {$ver == 1} { + # ttk::spinbox as entry + ::ttk::spinbox .t -exportselection 1 -values {1 2 3 4 5} + .t delete 0 end + .t insert end PAYLOAD + pack .t + .t selection range 0 end + update + return + } elseif {$ver == 2} { + # ttk::spinbox spun + ::ttk::spinbox .t -exportselection 1 -values {1 2 3 4 5} + ::ttk::spinbox::Spin .t +1 + ::ttk::spinbox::Spin .t +1 + pack .t + # ttk::spinbox::Spin sets selection + update + return + # selects 2 + } else { + # ttk::spinbox spun/selected/spun + ::ttk::spinbox .t -exportselection 1 -values {1 2 3 4 5} + ::ttk::spinbox::Spin .t +1 + ::ttk::spinbox::Spin .t +1 + pack .t + # ttk::spinbox::Spin sets selection + update + ::ttk::spinbox::Spin .t +1 + update + return + # selects 3 + } } } diff --git a/tests/scale.test b/tests/scale.test index f08015e..7d42070 100644 --- a/tests/scale.test +++ b/tests/scale.test @@ -30,7 +30,7 @@ test scale-1.1 {configuration options} -body { .s configure -activebackground [lindex [.s configure -activebackground] 3] } -result {#ff0000} test scale-1.2 {configuration options} -body { - .s configure -activebackground non-existent + .s configure -activebackground non-existent } -returnCodes error -result {unknown color name "non-existent"} test scale-1.3 {configuration options} -body { .s configure -background #ff0000 @@ -39,7 +39,7 @@ test scale-1.3 {configuration options} -body { .s configure -background [lindex [.s configure -background] 3] } -result {#ff0000} test scale-1.4 {configuration options} -body { - .s configure -background non-existent + .s configure -background non-existent } -returnCodes error -result {unknown color name "non-existent"} test scale-1.5 {configuration options} -body { .s configure -bd 4 @@ -48,7 +48,7 @@ test scale-1.5 {configuration options} -body { .s configure -bd [lindex [.s configure -bd] 3] } -result 4 test scale-1.6 {configuration options} -body { - .s configure -bd badValue + .s configure -bd badValue } -returnCodes error -result {expected screen distance but got "badValue"} test scale-1.7 {configuration options} -body { .s configure -bigincrement 12.5 @@ -57,7 +57,7 @@ test scale-1.7 {configuration options} -body { .s configure -bigincrement [lindex [.s configure -bigincrement] 3] } -result {12.5} test scale-1.8 {configuration options} -body { - .s configure -bigincrement badValue + .s configure -bigincrement badValue } -returnCodes error -result {expected floating-point number but got "badValue"} test scale-1.9 {configuration options} -body { .s configure -bg #ff0000 @@ -66,16 +66,16 @@ test scale-1.9 {configuration options} -body { .s configure -bg [lindex [.s configure -bg] 3] } -result {#ff0000} test scale-1.10 {configuration options} -body { - .s configure -bg non-existent + .s configure -bg non-existent } -returnCodes error -result {unknown color name "non-existent"} test scale-1.11 {configuration options} -body { .s configure -borderwidth 1.3 .s cget -borderwidth } -cleanup { .s configure -borderwidth [lindex [.s configure -borderwidth] 3] -} -result 1 +} -result 1.3 test scale-1.12 {configuration options} -body { - .s configure -borderwidth badValue + .s configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} test scale-1.13 {configuration options} -body { .s configure -command {set x} @@ -90,7 +90,7 @@ test scale-1.15 {configuration options} -body { .s configure -cursor [lindex [.s configure -cursor] 3] } -result {arrow} test scale-1.16 {configuration options} -body { - .s configure -cursor badValue + .s configure -cursor badValue } -returnCodes error -result {bad cursor spec "badValue"} test scale-1.17 {configuration options} -body { .s configure -digits 5 @@ -99,7 +99,7 @@ test scale-1.17 {configuration options} -body { .s configure -digits [lindex [.s configure -digits] 3] } -result 5 test scale-1.18 {configuration options} -body { - .s configure -digits badValue + .s configure -digits badValue } -returnCodes error -result {expected integer but got "badValue"} test scale-1.19 {configuration options} -body { .s configure -fg #00ff00 @@ -108,7 +108,7 @@ test scale-1.19 {configuration options} -body { .s configure -fg [lindex [.s configure -fg] 3] } -result {#00ff00} test scale-1.20 {configuration options} -body { - .s configure -fg badValue + .s configure -fg badValue } -returnCodes error -result {unknown color name "badValue"} test scale-1.21 {configuration options} -body { .s configure -font fixed @@ -123,7 +123,7 @@ test scale-1.23 {configuration options} -body { .s configure -foreground [lindex [.s configure -foreground] 3] } -result {green} test scale-1.24 {configuration options} -body { - .s configure -foreground badValue + .s configure -foreground badValue } -returnCodes error -result {unknown color name "badValue"} test scale-1.25 {configuration options} -body { .s configure -from -15.0 @@ -132,7 +132,7 @@ test scale-1.25 {configuration options} -body { .s configure -from [lindex [.s configure -from] 3] } -result {-15.0} test scale-1.26 {configuration options} -body { - .s configure -from badValue + .s configure -from badValue } -returnCodes error -result {expected floating-point number but got "badValue"} test scale-1.27 {configuration options} -body { .s configure -highlightbackground #112233 @@ -141,7 +141,7 @@ test scale-1.27 {configuration options} -body { .s configure -highlightbackground [lindex [.s configure -highlightbackground] 3] } -result {#112233} test scale-1.28 {configuration options} -body { - .s configure -highlightbackground ugly + .s configure -highlightbackground ugly } -returnCodes error -result {unknown color name "ugly"} test scale-1.29 {configuration options} -body { .s configure -highlightcolor #123456 @@ -150,7 +150,7 @@ test scale-1.29 {configuration options} -body { .s configure -highlightcolor [lindex [.s configure -highlightcolor] 3] } -result {#123456} test scale-1.30 {configuration options} -body { - .s configure -highlightcolor non-existent + .s configure -highlightcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} test scale-1.31 {configuration options} -body { .s configure -highlightthickness 2 @@ -159,7 +159,7 @@ test scale-1.31 {configuration options} -body { .s configure -highlightthickness [lindex [.s configure -highlightthickness] 3] } -result 2 test scale-1.32 {configuration options} -body { - .s configure -highlightthickness badValue + .s configure -highlightthickness badValue } -returnCodes error -result {expected screen distance but got "badValue"} test scale-1.33 {configuration options} -body { .s configure -label {Some text} @@ -174,7 +174,7 @@ test scale-1.35 {configuration options} -body { .s configure -length [lindex [.s configure -length] 3] } -result 130 test scale-1.36 {configuration options} -body { - .s configure -length badValue + .s configure -length badValue } -returnCodes error -result {expected screen distance but got "badValue"} test scale-1.37 {configuration options} -body { .s configure -orient horizontal @@ -183,7 +183,7 @@ test scale-1.37 {configuration options} -body { .s configure -orient [lindex [.s configure -orient] 3] } -result {horizontal} test scale-1.38 {configuration options} -body { - .s configure -orient badValue + .s configure -orient badValue } -returnCodes error -result {bad orient "badValue": must be horizontal or vertical} test scale-1.39 {configuration options} -body { .s configure -orient horizontal @@ -198,7 +198,7 @@ test scale-1.41 {configuration options} -body { .s configure -relief [lindex [.s configure -relief] 3] } -result {ridge} test scale-1.42 {configuration options} -body { - .s configure -relief badValue + .s configure -relief badValue } -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} test scale-1.43 {configuration options} -body { .s configure -repeatdelay 14 @@ -207,7 +207,7 @@ test scale-1.43 {configuration options} -body { .s configure -repeatdelay [lindex [.s configure -repeatdelay] 3] } -result 14 test scale-1.44 {configuration options} -body { - .s configure -repeatdelay bogus + .s configure -repeatdelay bogus } -returnCodes error -result {expected integer but got "bogus"} test scale-1.45 {configuration options} -body { .s configure -repeatinterval 14 @@ -216,7 +216,7 @@ test scale-1.45 {configuration options} -body { .s configure -repeatinterval [lindex [.s configure -repeatinterval] 3] } -result 14 test scale-1.46 {configuration options} -body { - .s configure -repeatinterval bogus + .s configure -repeatinterval bogus } -returnCodes error -result {expected integer but got "bogus"} test scale-1.47 {configuration options} -body { .s configure -resolution 2.0 @@ -225,7 +225,7 @@ test scale-1.47 {configuration options} -body { .s configure -resolution [lindex [.s configure -resolution] 3] } -result {2.0} test scale-1.48 {configuration options} -body { - .s configure -resolution badValue + .s configure -resolution badValue } -returnCodes error -result {expected floating-point number but got "badValue"} test scale-1.49 {configuration options} -body { .s configure -showvalue 0 @@ -234,7 +234,7 @@ test scale-1.49 {configuration options} -body { .s configure -showvalue [lindex [.s configure -showvalue] 3] } -result 0 test scale-1.50 {configuration options} -body { - .s configure -showvalue badValue + .s configure -showvalue badValue } -returnCodes error -result {expected boolean value but got "badValue"} test scale-1.51 {configuration options} -body { .s configure -sliderlength 86 @@ -243,7 +243,7 @@ test scale-1.51 {configuration options} -body { .s configure -sliderlength [lindex [.s configure -sliderlength] 3] } -result 86 test scale-1.52 {configuration options} -body { - .s configure -sliderlength badValue + .s configure -sliderlength badValue } -returnCodes error -result {expected screen distance but got "badValue"} test scale-1.53 {configuration options} -body { .s configure -sliderrelief raised @@ -252,7 +252,7 @@ test scale-1.53 {configuration options} -body { .s configure -sliderrelief [lindex [.s configure -sliderrelief] 3] } -result {raised} test scale-1.54 {configuration options} -body { - .s configure -sliderrelief badValue + .s configure -sliderrelief badValue } -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} test scale-1.55 {configuration options} -body { .s configure -state d @@ -261,7 +261,7 @@ test scale-1.55 {configuration options} -body { .s configure -state [lindex [.s configure -state] 3] } -result {disabled} test scale-1.56 {configuration options} -body { - .s configure -state badValue + .s configure -state badValue } -returnCodes error -result {bad state "badValue": must be active, disabled, or normal} test scale-1.57 {configuration options} -body { .s configure -state n @@ -282,7 +282,7 @@ test scale-1.61 {configuration options} -body { .s configure -tickinterval [lindex [.s configure -tickinterval] 3] } -result {4.0} test scale-1.62 {configuration options} -body { - .s configure -tickinterval badValue + .s configure -tickinterval badValue } -returnCodes error -result {expected floating-point number but got "badValue"} test scale-1.63 {configuration options} -body { .s configure -to 14.9 @@ -291,7 +291,7 @@ test scale-1.63 {configuration options} -body { .s configure -to [lindex [.s configure -to] 3] } -result {15.0} test scale-1.64 {configuration options} -body { - .s configure -to badValue + .s configure -to badValue } -returnCodes error -result {expected floating-point number but got "badValue"} test scale-1.65 {configuration options} -body { .s configure -troughcolor #ff0000 @@ -300,7 +300,7 @@ test scale-1.65 {configuration options} -body { .s configure -troughcolor [lindex [.s configure -troughcolor] 3] } -result {#ff0000} test scale-1.66 {configuration options} -body { - .s configure -troughcolor non-existent + .s configure -troughcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} test scale-1.67 {configuration options} -body { .s configure -variable x @@ -315,7 +315,7 @@ test scale-1.69 {configuration options} -body { .s configure -width [lindex [.s configure -width] 3] } -result 32 test scale-1.70 {configuration options} -body { - .s configure -width badValue + .s configure -width badValue } -returnCodes error -result {expected screen distance but got "badValue"} destroy .s @@ -556,7 +556,7 @@ test scale-5.5 {ConfigureScale procedure} -setup { } -body { scale .s -from 1.11 -to 1.89 -resolution .1 -tickinterval .76 list [format %.1f [.s cget -from]] [format %.1f [.s cget -to]] \ - [format %.1f [.s cget -tickinterval]] + [format %.1f [.s cget -tickinterval]] } -cleanup { deleteWindows } -result {1.1 1.9 0.8} @@ -726,7 +726,7 @@ test scale-7.3 {ComputeScaleGeometry procedure} -constraints { deleteWindows } -body { scale .s -from 0 -to 1000 -orient vertical -showvalue 0 -width 10 \ - -sliderlength 10 + -sliderlength 10 pack .s update list [winfo reqwidth .s] [winfo reqheight .s] @@ -739,7 +739,7 @@ test scale-7.4 {ComputeScaleGeometry procedure} -constraints { deleteWindows } -body { scale .s -from 0 -to 1000 -orient vertical -showvalue 0 -bd 5 \ - -relief sunken + -relief sunken pack .s update list [winfo reqwidth .s] [winfo reqheight .s] @@ -764,7 +764,7 @@ test scale-7.6 {ComputeScaleGeometry procedure} -constraints { deleteWindows } -body { scale .s -from 0 -to 1000 -label "Long string" -orient horizontal \ - -tick 500 + -tick 500 pack .s update list [winfo reqwidth .s] [winfo reqheight .s] @@ -787,7 +787,7 @@ test scale-7.8 {ComputeScaleGeometry procedure} -setup { deleteWindows } -body { scale .s -from 0 -to 1000 -orient horizontal -showvalue 0 -bd 5 \ - -relief raised -highlightthickness 2 + -relief raised -highlightthickness 2 pack .s update list [winfo reqwidth .s] [winfo reqheight .s] @@ -806,7 +806,7 @@ test scale-8.1 {ScaleElement procedure} -constraints { .s set 30 update list [.s identify 53 52] [.s identify 54 52] [.s identify 70 52] \ - [.s identify 71 52] + [.s identify 71 52] } -cleanup { deleteWindows } -result {{} trough1 trough1 {}} @@ -820,7 +820,7 @@ test scale-8.2 {ScaleElement procedure} -constraints { .s set 30 update list [.s identify 60 2] [.s identify 60 3] [.s identify 60 302] \ - [.s identify 60 303] + [.s identify 60 303] } -cleanup { deleteWindows } -result {{} trough1 trough2 {}} @@ -834,7 +834,7 @@ test scale-8.3 {ScaleElement procedure} -constraints { .s set 30 update list [.s identify 60 83] [.s identify 60 84] [.s identify 60 113] \ - [.s identify 60 114] \ + [.s identify 60 114] \ } -cleanup { deleteWindows } -result {trough1 slider slider trough2} @@ -842,12 +842,12 @@ test scale-8.4 {ScaleElement procedure} -setup { deleteWindows } -body { scale .s -from 0 -to 100 -orient vertical -bd 4 -width 10 \ - -highlightthickness 1 -length 300 -showvalue 0 + -highlightthickness 1 -length 300 -showvalue 0 pack .s .s set 30 update list [.s identify 4 40] [.s identify 5 40] [.s identify 22 40] \ - [.s identify 23 40] \ + [.s identify 23 40] \ } -cleanup { deleteWindows } -result {{} trough1 trough1 {}} @@ -857,13 +857,13 @@ test scale-8.5 {ScaleElement procedure} -constraints { deleteWindows } -body { scale .s -from 0 -to 100 -orient horizontal -bd 1 \ - -highlightthickness 2 -tick 20 -sliderlength 20 \ - -length 200 -label Test + -highlightthickness 2 -tick 20 -sliderlength 20 \ + -length 200 -label Test pack .s .s set 30 update list [.s identify 150 36] [.s identify 150 37] [.s identify 150 53] \ - [.s identify 150 54] + [.s identify 150 54] } -cleanup { deleteWindows } -result {{} trough2 trough2 {}} @@ -873,12 +873,12 @@ test scale-8.6 {ScaleElement procedure} -constraints { deleteWindows } -body { scale .s -from 0 -to 100 -orient horizontal -bd 2 \ - -highlightthickness 1 -tick 20 -length 200 + -highlightthickness 1 -tick 20 -length 200 pack .s .s set 30 update list [.s identify 150 20] [.s identify 150 21] [.s identify 150 39] \ - [.s identify 150 40] + [.s identify 150 40] } -cleanup { deleteWindows } -result {{} trough2 trough2 {}} @@ -886,12 +886,12 @@ test scale-8.7 {ScaleElement procedure} -setup { deleteWindows } -body { scale .s -from 0 -to 100 -orient horizontal -bd 4 -highlightthickness 2 \ - -length 200 -width 10 -showvalue 0 + -length 200 -width 10 -showvalue 0 pack .s .s set 30 update list [.s identify 30 5] [.s identify 30 6] [.s identify 30 23] \ - [.s identify 30 24] + [.s identify 30 24] } -cleanup { deleteWindows } -result {{} trough1 trough1 {}} @@ -899,12 +899,12 @@ test scale-8.8 {ScaleElement procedure} -setup { deleteWindows } -body { scale .s -from 0 -to 100 -orient horizontal -bd 1 -highlightthickness 2 \ - -tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0 + -tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0 pack .s .s set 30 update list [.s identify 2 28] [.s identify 3 28] [.s identify 202 28] \ - [.s identify 203 28] + [.s identify 203 28] } -cleanup { deleteWindows } -result {{} trough1 trough2 {}} @@ -912,12 +912,12 @@ test scale-8.9 {ScaleElement procedure} -setup { deleteWindows } -body { scale .s -from 0 -to 100 -orient horizontal -bd 1 -highlightthickness 2 \ - -tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0 + -tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0 pack .s .s set 80 update list [.s identify 145 28] [.s identify 146 28] [.s identify 165 28] \ - [.s identify 166 28] + [.s identify 166 28] } -cleanup { deleteWindows } -result {trough1 slider slider trough2} @@ -968,7 +968,7 @@ test scale-9.8 {PixelToValue procedure} -body { } -result 100 test scale-9.9 {PixelToValue procedure} -body { .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal + -orient horizontal update .s get 76 152 } -result 65 @@ -981,7 +981,7 @@ test scale-10.1 {ValueToPixel procedure} -constraints { deleteWindows } -body { scale .s -from 0 -to 100 -sliderlength 20 -length 124 -bd 2 \ - -orient horizontal -label Test -tick 20 + -orient horizontal -label Test -tick 20 pack .s update list [.s coords -10] [.s coords 40] [.s coords 1000] @@ -994,7 +994,7 @@ test scale-10.2 {ValueToPixel procedure} -constraints { deleteWindows } -body { scale .s -from 100 -to 0 -sliderlength 20 -length 122 -bd 1 \ - -orient vertical -label Test -tick 20 + -orient vertical -label Test -tick 20 pack .s update list [.s coords -10] [.s coords 40] [.s coords 1000] @@ -1007,11 +1007,11 @@ test scale-11.1 {ScaleEventProc procedure} -setup { deleteWindows } -body { proc killScale value { - global x - if {$value > 30} { - destroy .s1 - lappend x [winfo exists .s1] [info commands .s1] - } + global x + if {$value > 30} { + destroy .s1 + lappend x [winfo exists .s1] [info commands .s1] + } } set x initial scale .s1 -from 0 -to 100 -command killScale @@ -1083,8 +1083,8 @@ test scale-13.5 {SetScaleValue procedure} -body { } -result 100 test scale-13.6 {SetScaleValue procedure} -body { proc varTrace args { - global traceInfo - set traceInfo $args + global traceInfo + set traceInfo $args } .s configure -from 0 -to 100 -command {set x} -variable y update @@ -1106,78 +1106,78 @@ pack [scale .s] update test scale-14.1 {RoundValueToResolution procedure} -body { .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 4.0 + -orient horizontal -resolution 4.0 update .s get 84 152 } -result 72 test scale-14.2 {RoundValueToResolution procedure} -body { .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 4.0 + -orient horizontal -resolution 4.0 update .s get 86 152 } -result 76 test scale-14.3 {RoundValueToResolution procedure} -body { .s configure -from 100 -to 0 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 4.0 + -orient horizontal -resolution 4.0 update .s get 84 152 } -result 28 test scale-14.4 {RoundValueToResolution procedure} -body { .s configure -from 100 -to 0 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 4.0 + -orient horizontal -resolution 4.0 update .s get 86 152 } -result 24 test scale-14.5 {RoundValueToResolution procedure} -body { .s configure -from -100 -to 0 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 4.0 + -orient horizontal -resolution 4.0 update .s get 84 152 } -result -28 test scale-14.6 {RoundValueToResolution procedure} -body { .s configure -from -100 -to 0 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 4.0 + -orient horizontal -resolution 4.0 update .s get 86 152 } -result -24 test scale-14.7 {RoundValueToResolution procedure} -body { .s configure -from 0 -to -100 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 4.0 + -orient horizontal -resolution 4.0 update .s get 84 152 } -result -72 test scale-14.8 {RoundValueToResolution procedure} -body { .s configure -from 0 -to -100 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 4.0 + -orient horizontal -resolution 4.0 update .s get 86 152 } -result -76 test scale-14.9 {RoundValueToResolution procedure} -body { .s configure -from 0 -to 2.25 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 0 + -orient horizontal -resolution 0 update .s get 84 152 } -result {1.64} test scale-14.10 {RoundValueToResolution procedure} -body { .s configure -from 0 -to 2.25 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 0 + -orient horizontal -resolution 0 update .s get 86 152 } -result {1.69} test scale-14.11 {RoundValueToResolution procedure} -body { .s configure -from 0 -to 225 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 0 -digits 5 + -orient horizontal -resolution 0 -digits 5 update .s get 84 152 } -result {164.25} test scale-14.12 {RoundValueToResolution procedure} -body { .s configure -from 0 -to 225 -sliderlength 10 -length 114 -bd 2 \ - -orient horizontal -resolution 0 -digits 5 + -orient horizontal -resolution 0 -digits 5 update .s get 86 152 } -result {168.75} @@ -1211,7 +1211,7 @@ test scale-14a.2 {RoundValueToResolution, RoundIntervalToResolution procedures} update } -body { .s configure -length 400 -bd 0 -from -1.5 -to 1.5 -resolution 1 \ - -tickinterval 1 -digits 2 + -tickinterval 1 -digits 2 update .s get 250 0 } -cleanup { @@ -1245,7 +1245,7 @@ test scale-15.3 {ScaleVarProc procedure} -setup { set y 40q } -cleanup { deleteWindows -} -returnCodes error -result {can't set "y": can't assign non-numeric value to scale variable} +} -returnCodes error -result {can't set "y": cannot assign a non-numeric value to a scale variable} test scale-15.4 {ScaleVarProc procedure} -setup { deleteWindows } -body { @@ -1266,7 +1266,7 @@ test scale-15.5 {ScaleVarProc procedure} -setup { set y x } -cleanup { deleteWindows -} -returnCodes error -result {can't set "y": can't assign non-numeric value to scale variable} +} -returnCodes error -result {can't set "y": cannot assign a non-numeric value to a scale variable} test scale-15.6 {ScaleVarProc procedure} -setup { deleteWindows } -body { @@ -1283,7 +1283,7 @@ test scale-15.7 {ScaleVarProc procedure, variable deleted} -setup { } -body { set y 6 scale .s -from 10 -to 0 -variable y -orient horizontal -length 150 \ - -command "set x" + -command "set x" pack .s update set x untouched @@ -1298,7 +1298,7 @@ test scale-15.8 {ScaleVarProc procedure, don't call -command} -setup { } -body { set y 6 scale .s -from 0 -to 100 -variable y -orient horizontal -length 150 \ - -command "set x" + -command "set x" pack .s update set x untouched @@ -1364,10 +1364,10 @@ test scale-18.2 {Scale button 1 events [Bug 787065]} -setup { pack .s tkwait visibility .s list [catch { - event generate .s <Button-1> -x 0 -y 0 - event generate .s <ButtonRelease-1> -x 0 -y 0 - update - set ::error + event generate .s <Button-1> -x 0 -y 0 + event generate .s <ButtonRelease-1> -x 0 -y 0 + update + set ::error } msg] $msg } -cleanup { unset ::error @@ -1385,10 +1385,10 @@ test scale-18.3 {Scale button 2 events [Bug 787065]} -setup { pack .s tkwait visibility .s list [catch { - event generate .s <Button-2> -x 0 -y 0 - event generate .s <ButtonRelease-2> -x 0 -y 0 - update - set ::error + event generate .s <Button-2> -x 0 -y 0 + event generate .s <ButtonRelease-2> -x 0 -y 0 + update + set ::error } msg] $msg } -cleanup { unset ::error @@ -1399,7 +1399,7 @@ test scale-18.3 {Scale button 2 events [Bug 787065]} -setup { test scale-18.4 {Bug [415415ffff] - Long callback: One click -> Several steps} -setup { catch {destroy .s} scale .s -from 0 -to 5 -resolution 1 -variable x1 -orient horizontal -length 100 \ - -command longCmd -repeatdelay 300 + -command longCmd -repeatdelay 300 pack .s update proc longCmd {unused} { @@ -1418,35 +1418,35 @@ test scale-18.4 {Bug [415415ffff] - Long callback: One click -> Several steps} - test scale-19 {Bug [3529885fff] - Click in through goes in wrong direction} \ -setup { - catch {destroy .s} - catch {destroy .s1 .s2 .s3 .s4} - unset -nocomplain x1 x2 x3 x4 x y - scale .s1 -from 0 -to 100 -resolution 1 -variable x1 -digits 4 -orient horizontal -length 100 - scale .s2 -from 0 -to 100 -resolution -1 -variable x2 -digits 4 -orient horizontal -length 100 - scale .s3 -from 100 -to 0 -resolution 1 -variable x3 -digits 4 -orient horizontal -length 100 - scale .s4 -from 100 -to 0 -resolution -1 -variable x4 -digits 4 -orient horizontal -length 100 - pack .s1 .s2 .s3 .s4 -side left - update + catch {destroy .s} + catch {destroy .s1 .s2 .s3 .s4} + unset -nocomplain x1 x2 x3 x4 x y + scale .s1 -from 0 -to 100 -resolution 1 -variable x1 -digits 4 -orient horizontal -length 100 + scale .s2 -from 0 -to 100 -resolution -1 -variable x2 -digits 4 -orient horizontal -length 100 + scale .s3 -from 100 -to 0 -resolution 1 -variable x3 -digits 4 -orient horizontal -length 100 + scale .s4 -from 100 -to 0 -resolution -1 -variable x4 -digits 4 -orient horizontal -length 100 + pack .s1 .s2 .s3 .s4 -side left + update } \ -body { - foreach {x y} [.s1 coord 50] {} - event generate .s1 <Button-1> -x $x -y $y - event generate .s1 <ButtonRelease-1> -x $x -y $y - foreach {x y} [.s2 coord 50] {} - event generate .s2 <Button-1> -x $x -y $y - event generate .s2 <ButtonRelease-1> -x $x -y $y - foreach {x y} [.s3 coord 50] {} - event generate .s3 <Button-1> -x $x -y $y - event generate .s3 <ButtonRelease-1> -x $x -y $y - foreach {x y} [.s4 coord 50] {} - event generate .s4 <Button-1> -x $x -y $y - event generate .s4 <ButtonRelease-1> -x $x -y $y - update - list $x1 $x2 $x3 $x4 + foreach {x y} [.s1 coord 50] {} + event generate .s1 <Button-1> -x $x -y $y + event generate .s1 <ButtonRelease-1> -x $x -y $y + foreach {x y} [.s2 coord 50] {} + event generate .s2 <Button-1> -x $x -y $y + event generate .s2 <ButtonRelease-1> -x $x -y $y + foreach {x y} [.s3 coord 50] {} + event generate .s3 <Button-1> -x $x -y $y + event generate .s3 <ButtonRelease-1> -x $x -y $y + foreach {x y} [.s4 coord 50] {} + event generate .s4 <Button-1> -x $x -y $y + event generate .s4 <ButtonRelease-1> -x $x -y $y + update + list $x1 $x2 $x3 $x4 } \ -cleanup { - unset x1 x2 x3 x4 x y - destroy .s1 .s2 .s3 .s4 + unset x1 x2 x3 x4 x y + destroy .s1 .s2 .s3 .s4 } \ -result {1.0 1.0 1.0 1.0} @@ -1596,7 +1596,7 @@ test scale-22.1 {Bug [5d991b822e]} { set var INIT scale .b -variable var trace add variable var unset {apply {args { - .b configure -variable {} + .b configure -variable {} }}} pack .b bind .b <Configure> {unset var} @@ -1608,7 +1608,7 @@ test scale-22.2 {Bug [5d991b822e]} { set var INIT scale .b -variable var trace add variable var unset {apply {args { - .b configure -variable new + .b configure -variable new }}} pack .b bind .b <Configure> {unset -nocomplain var} diff --git a/tests/scrollbar.test b/tests/scrollbar.test index ef24860..ad24d8d 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -18,38 +18,38 @@ proc scroll args { proc getTroughSize {w} { if {[testConstraint testmetrics]} { - # Only Windows has [testmetrics] + # Only Windows has [testmetrics] if [string match v* [$w cget -orient]] { return [expr {[winfo height $w] - 2*[testmetrics cyvscroll $w]}] } else { return [expr {[winfo width $w] - 2*[testmetrics cxhscroll $w]}] } } else { - if {[tk windowingsystem] eq "x11"} { - # Calculations here assume that the arrow area is a square. + if {[tk windowingsystem] eq "x11"} { + # Calculations here assume that the arrow area is a square. if [string match v* [$w cget -orient]] { - return [expr {[winfo height $w] \ - - ([winfo width $w] \ + return [expr {[winfo height $w] \ + - ([winfo width $w] \ - [$w cget -highlightthickness] \ - [$w cget -bd] + 1)*2}] } else { - return [expr {[winfo width $w] \ - - ([winfo height $w] \ + return [expr {[winfo width $w] \ + - ([winfo height $w] \ - [$w cget -highlightthickness] \ - [$w cget -bd] + 1)*2}] } - } else { - # macOS aqua + } else { + # macOS aqua if [string match v* [$w cget -orient]] { - return [expr {[winfo height $w] \ + return [expr {[winfo height $w] \ - ([$w cget -highlightthickness] \ +[$w cget -bd])*2}] } else { - return [expr {[winfo width $w] \ + return [expr {[winfo width $w] \ - ([$w cget -highlightthickness] \ +[$w cget -bd])*2}] } - } + } } } @@ -78,7 +78,7 @@ foreach test { {-bd 4 4 badValue {expected screen distance but got "badValue"}} {-bg #ff0000 #ff0000 non-existent {unknown color name "non-existent"}} - {-borderwidth 1.3 1 badValue {expected screen distance but got "badValue"}} + {-borderwidth 1.3 1.3 badValue {expected screen distance but got "badValue"}} {-command "set x" {set x} {} {}} {-elementborderwidth 4 4 badValue {expected screen distance but got "badValue"}} {-cursor arrow arrow badValue {bad cursor spec "badValue"}} @@ -302,10 +302,10 @@ if {[testConstraint testmetrics]} { place configure .t.s -width [expr {2*[testmetrics cxhscroll .t.s]+1}] } else { if {[tk windowingsystem] eq "x11"} { - place configure .t.s -width [expr {[winfo height .t.s] - 2*([.t.s cget -highlightthickness] + [.t.s cget -bd] + 1)}] + place configure .t.s -width [expr {[winfo height .t.s] - 2*([.t.s cget -highlightthickness] + [.t.s cget -bd] + 1)}] } else { - # macOS aqua - place configure .t.s -width [expr {2*([.t.s cget -highlightthickness] + [.t.s cget -bd])}] + # macOS aqua + place configure .t.s -width [expr {2*([.t.s cget -highlightthickness] + [.t.s cget -bd])}] } } update @@ -718,9 +718,9 @@ test scrollbar-10.3 {<MouseWheel> event on horizontal scrollbar} -setup { test scrollbar-11.1 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destruction} -body { proc destroy_scrollbar {} { - if {[winfo exists .top.s]} { - destroy .top.s - } + if {[winfo exists .top.s]} { + destroy .top.s + } } toplevel .top scrollbar .top.s @@ -735,9 +735,9 @@ test scrollbar-11.1 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destructi } -result {} test scrollbar-11.2 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destruction} -body { proc destroy_scrollbar {{y 0}} { - if {[winfo exists .top.s]} { - destroy .top.s - } + if {[winfo exists .top.s]} { + destroy .top.s + } } toplevel .top wm minsize .top 50 400 diff --git a/tests/select.test b/tests/select.test index 55f9184..ea7be2b 100644 --- a/tests/select.test +++ b/tests/select.test @@ -20,7 +20,7 @@ tcltest::loadTestedCommands testConstraint cliboardManagerPresent 0 if {![catch {selection get -selection CLIPBOARD_MANAGER -type TARGETS}]} { if {"SAVE_TARGETS" in [selection get -selection CLIPBOARD_MANAGER -type TARGETS]} { - testConstraint cliboardManagerPresent 1 + testConstraint cliboardManagerPresent 1 } } testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}] @@ -886,7 +886,7 @@ test select-9.1 {SelCvtToX and SelCvtFromX procedures} -setup { set selValue "1024" set selInfo "" selection handle -selection PRIMARY -format INTEGER -type TEST \ - .f1 {handler TEST} + .f1 {handler TEST} update set result "" lappend result [dobg {selection get TEST}] diff --git a/tests/spinbox.test b/tests/spinbox.test index 6cb52e9..87fb946 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -14,35 +14,35 @@ tcltest::loadTestedCommands # For xscrollcommand set scrollInfo {} proc scroll args { - global scrollInfo - set scrollInfo $args + global scrollInfo + set scrollInfo $args } # For trace add variable proc override args { - global x - set x 12345 + global x + set x 12345 } # Procedures used in widget VALIDATION tests proc doval {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 1 + set ::vVals [list $W $d $i $P $s $S $v $V] + return 1 } proc doval2 {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - set ::e mydata - return 1 + set ::vVals [list $W $d $i $P $s $S $v $V] + set ::e mydata + return 1 } proc doval3 {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 0 + set ::vVals [list $W $d $i $P $s $S $v $V] + return 0 } set cy [font metrics {Courier -12} -linespace] test spinbox-1.1 {configuration option: "activebackground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -52,19 +52,19 @@ test spinbox-1.1 {configuration option: "activebackground"} -setup { destroy .e } -result {#ff0000} test spinbox-1.2 {configuration option: "activebackground" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -activebackground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test spinbox-1.3 {configuration option: "background"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -74,19 +74,19 @@ test spinbox-1.3 {configuration option: "background"} -setup { destroy .e } -result {#ff0000} test spinbox-1.4 {configuration option: "background" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -background non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test spinbox-1.5 {configuration option: "bd"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -96,19 +96,19 @@ test spinbox-1.5 {configuration option: "bd"} -setup { destroy .e } -result 4 test spinbox-1.6 {configuration option: "bd" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -bd badValue } -cleanup { destroy .e -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test spinbox-1.7 {configuration option: "bg"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -118,19 +118,19 @@ test spinbox-1.7 {configuration option: "bg"} -setup { destroy .e } -result {#ff0000} test spinbox-1.8 {configuration option: "bg" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -bg non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test spinbox-1.9 {configuration option: "borderwidth"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -138,21 +138,21 @@ test spinbox-1.9 {configuration option: "borderwidth"} -setup { .e cget -borderwidth } -cleanup { destroy .e -} -result 1 +} -result 1.3 test spinbox-1.10 {configuration option: "borderwidth" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -borderwidth badValue } -cleanup { destroy .e -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test spinbox-1.11 {configuration option: "buttonbackground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -162,19 +162,19 @@ test spinbox-1.11 {configuration option: "buttonbackground"} -setup { destroy .e } -result {#ff0000} test spinbox-1.12 {configuration option: "buttonbackground" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -buttonbackground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test spinbox-1.13 {configuration option: "buttoncursor"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -184,19 +184,19 @@ test spinbox-1.13 {configuration option: "buttoncursor"} -setup { destroy .e } -result {arrow} test spinbox-1.14 {configuration option: "buttoncursor" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -buttoncursor badValue } -cleanup { destroy .e -} -returnCodes {error} -result {bad cursor spec "badValue"} +} -returnCodes error -result {bad cursor spec "badValue"} test spinbox-1.15 {configuration option: "command"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -207,8 +207,8 @@ test spinbox-1.15 {configuration option: "command"} -setup { } -result {a command} test spinbox-1.16 {configuration option: "cursor"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -218,19 +218,19 @@ test spinbox-1.16 {configuration option: "cursor"} -setup { destroy .e } -result {arrow} test spinbox-1.17 {configuration option: "cursor" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -cursor badValue } -cleanup { destroy .e -} -returnCodes {error} -result {bad cursor spec "badValue"} +} -returnCodes error -result {bad cursor spec "badValue"} test spinbox-1.18 {configuration option: "disabledbackground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -240,19 +240,19 @@ test spinbox-1.18 {configuration option: "disabledbackground"} -setup { destroy .e } -result {green} test spinbox-1.19 {configuration option: "disabledbackground" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -disabledbackground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test spinbox-1.20 {configuration option: "disabledforeground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -262,19 +262,19 @@ test spinbox-1.20 {configuration option: "disabledforeground"} -setup { destroy .e } -result {#110022} test spinbox-1.21 {configuration option: "disabledforeground" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -disabledforeground bogus } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "bogus"} +} -returnCodes error -result {unknown color name "bogus"} test spinbox-1.22 {configuration option: "exportselection"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -284,19 +284,19 @@ test spinbox-1.22 {configuration option: "exportselection"} -setup { destroy .e } -result 1 test spinbox-1.23 {configuration option: "exportselection" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -exportselection xyzzy } -cleanup { destroy .e -} -returnCodes {error} -result {expected boolean value but got "xyzzy"} +} -returnCodes error -result {expected boolean value but got "xyzzy"} test spinbox-1.24 {configuration option: "fg"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -306,19 +306,19 @@ test spinbox-1.24 {configuration option: "fg"} -setup { destroy .e } -result {#110022} test spinbox-1.25 {configuration option: "fg" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -fg bogus } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "bogus"} +} -returnCodes error -result {unknown color name "bogus"} test spinbox-1.26 {configuration option: "font"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -328,19 +328,19 @@ test spinbox-1.26 {configuration option: "font"} -setup { destroy .e } -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*} test spinbox-1.27 {configuration option: "font" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -font {} } -cleanup { destroy .e -} -returnCodes {error} -result {font "" doesn't exist} +} -returnCodes error -result {font "" does not exist} test spinbox-1.28 {configuration option: "foreground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -350,19 +350,19 @@ test spinbox-1.28 {configuration option: "foreground"} -setup { destroy .e } -result {#110022} test spinbox-1.29 {configuration option: "foreground" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -foreground bogus } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "bogus"} +} -returnCodes error -result {unknown color name "bogus"} test spinbox-1.30 {configuration option: "format"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -372,19 +372,19 @@ test spinbox-1.30 {configuration option: "format"} -setup { destroy .e } -result {%0.5f} test spinbox-1.31 {configuration option: "format" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -format %d } -cleanup { destroy .e -} -returnCodes {error} -result {bad spinbox format specifier "%d"} +} -returnCodes error -result {bad spinbox format specifier "%d"} test spinbox-1.32 {configuration option: "from"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -394,19 +394,19 @@ test spinbox-1.32 {configuration option: "from"} -setup { destroy .e } -result {-10.0} test spinbox-1.33 {configuration option: "from" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -from bogus } -cleanup { destroy .e -} -returnCodes {error} -result {expected floating-point number but got "bogus"} +} -returnCodes error -result {expected floating-point number but got "bogus"} test spinbox-1.34 {configuration option: "highlightbackground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -416,19 +416,19 @@ test spinbox-1.34 {configuration option: "highlightbackground"} -setup { destroy .e } -result {#123456} test spinbox-1.35 {configuration option: "highlightbackground" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -highlightbackground ugly } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "ugly"} +} -returnCodes error -result {unknown color name "ugly"} test spinbox-1.36 {configuration option: "highlightcolor"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -438,19 +438,19 @@ test spinbox-1.36 {configuration option: "highlightcolor"} -setup { destroy .e } -result {#123456} test spinbox-1.37 {configuration option: "highlightcolor" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -highlightcolor bogus } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "bogus"} +} -returnCodes error -result {unknown color name "bogus"} test spinbox-1.38 {configuration option: "highlightthickness"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -460,19 +460,19 @@ test spinbox-1.38 {configuration option: "highlightthickness"} -setup { destroy .e } -result 6 test spinbox-1.39 {configuration option: "highlightthickness" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -highlightthickness bogus } -cleanup { destroy .e -} -returnCodes {error} -result {expected screen distance but got "bogus"} +} -returnCodes error -result {expected screen distance but got "bogus"} test spinbox-1.40 {configuration option: "highlightthickness"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -483,8 +483,8 @@ test spinbox-1.40 {configuration option: "highlightthickness"} -setup { } -result 0 test spinbox-1.41 {configuration option: "increment"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -494,19 +494,19 @@ test spinbox-1.41 {configuration option: "increment"} -setup { destroy .e } -result {1.0} test spinbox-1.42 {configuration option: "increment" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -increment bogus } -cleanup { destroy .e -} -returnCodes {error} -result {expected floating-point number but got "bogus"} +} -returnCodes error -result {expected floating-point number but got "bogus"} test spinbox-1.43 {configuration option: "insertbackground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -516,19 +516,19 @@ test spinbox-1.43 {configuration option: "insertbackground"} -setup { destroy .e } -result {#110022} test spinbox-1.44 {configuration option: "insertbackground" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -insertbackground bogus } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "bogus"} +} -returnCodes error -result {unknown color name "bogus"} test spinbox-1.45 {configuration option: "insertborderwidth"} -setup { - spinbox .e -borderwidth 2 -insertwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -insertwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -536,21 +536,21 @@ test spinbox-1.45 {configuration option: "insertborderwidth"} -setup { .e cget -insertborderwidth } -cleanup { destroy .e -} -result 1 +} -result 1.3 test spinbox-1.46 {configuration option: "insertborderwidth" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -insertborderwidth 2.6x } -cleanup { destroy .e -} -returnCodes {error} -result {expected screen distance but got "2.6x"} +} -returnCodes error -result {expected screen distance but got "2.6x"} test spinbox-1.47 {configuration option: "insertofftime"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -560,19 +560,19 @@ test spinbox-1.47 {configuration option: "insertofftime"} -setup { destroy .e } -result 100 test spinbox-1.48 {configuration option: "insertofftime" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -insertofftime 3.2 } -cleanup { destroy .e -} -returnCodes {error} -result {expected integer but got "3.2"} +} -returnCodes error -result {expected integer but got "3.2"} test spinbox-1.49 {configuration option: "insertontime"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -582,19 +582,19 @@ test spinbox-1.49 {configuration option: "insertontime"} -setup { destroy .e } -result 100 test spinbox-1.50 {configuration option: "insertontime" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -insertontime 3.2 } -cleanup { destroy .e -} -returnCodes {error} -result {expected integer but got "3.2"} +} -returnCodes error -result {expected integer but got "3.2"} test spinbox-1.51 {configuration option: "invalidcommand"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -605,8 +605,8 @@ test spinbox-1.51 {configuration option: "invalidcommand"} -setup { } -result {a command} test spinbox-1.52 {configuration option: "invcmd"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -617,8 +617,8 @@ test spinbox-1.52 {configuration option: "invcmd"} -setup { } -result {a command} test spinbox-1.53 {configuration option: "justify"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -628,19 +628,19 @@ test spinbox-1.53 {configuration option: "justify"} -setup { destroy .e } -result {right} test spinbox-1.54 {configuration option: "justify" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -justify bogus } -cleanup { destroy .e -} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} +} -returnCodes error -result {bad justification "bogus": must be left, right, or center} test spinbox-1.55 {configuration option: "readonlybackground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -650,19 +650,19 @@ test spinbox-1.55 {configuration option: "readonlybackground"} -setup { destroy .e } -result {green} test spinbox-1.56 {configuration option: "readonlybackground" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -readonlybackground non-existent } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "non-existent"} +} -returnCodes error -result {unknown color name "non-existent"} test spinbox-1.57 {configuration option: "relief"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -672,19 +672,19 @@ test spinbox-1.57 {configuration option: "relief"} -setup { destroy .e } -result {groove} test spinbox-1.58 {configuration option: "relief" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -relief 1.5 } -cleanup { destroy .e -} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} test spinbox-1.59 {configuration option: "repeatdelay"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -694,19 +694,19 @@ test spinbox-1.59 {configuration option: "repeatdelay"} -setup { destroy .e } -result 500 test spinbox-1.60 {configuration option: "repeatdelay" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -repeatdelay 3p } -cleanup { destroy .e -} -returnCodes {error} -result {expected integer but got "3p"} +} -returnCodes error -result {expected integer but got "3p"} test spinbox-1.61 {configuration option: "repeatinterval"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -716,19 +716,19 @@ test spinbox-1.61 {configuration option: "repeatinterval"} -setup { destroy .e } -result -500 test spinbox-1.62 {configuration option: "repeatinterval" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -repeatinterval 3p } -cleanup { destroy .e -} -returnCodes {error} -result {expected integer but got "3p"} +} -returnCodes error -result {expected integer but got "3p"} test spinbox-1.63 {configuration option: "selectbackground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -738,19 +738,19 @@ test spinbox-1.63 {configuration option: "selectbackground"} -setup { destroy .e } -result {#110022} test spinbox-1.64 {configuration option: "selectbackground" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -selectbackground bogus } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "bogus"} +} -returnCodes error -result {unknown color name "bogus"} test spinbox-1.65 {configuration option: "selectborderwidth"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -758,21 +758,21 @@ test spinbox-1.65 {configuration option: "selectborderwidth"} -setup { .e cget -selectborderwidth } -cleanup { destroy .e -} -result 1 +} -result 1.3 test spinbox-1.66 {configuration option: "selectborderwidth" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -selectborderwidth badValue } -cleanup { destroy .e -} -returnCodes {error} -result {expected screen distance but got "badValue"} +} -returnCodes error -result {expected screen distance but got "badValue"} test spinbox-1.67 {configuration option: "selectforeground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -782,19 +782,19 @@ test spinbox-1.67 {configuration option: "selectforeground"} -setup { destroy .e } -result {#654321} test spinbox-1.68 {configuration option: "selectforeground" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -selectforeground bogus } -cleanup { destroy .e -} -returnCodes {error} -result {unknown color name "bogus"} +} -returnCodes error -result {unknown color name "bogus"} test spinbox-1.69 {configuration option: "state"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -804,19 +804,19 @@ test spinbox-1.69 {configuration option: "state"} -setup { destroy .e } -result {normal} test spinbox-1.70 {configuration option: "state" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -state bogus } -cleanup { destroy .e -} -returnCodes {error} -result {bad state "bogus": must be disabled, normal, or readonly} +} -returnCodes error -result {bad state "bogus": must be disabled, normal, or readonly} test spinbox-1.71 {configuration option: "takefocus"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -827,8 +827,8 @@ test spinbox-1.71 {configuration option: "takefocus"} -setup { } -result {any string} test spinbox-1.72 {configuration option: "textvariable"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -839,8 +839,8 @@ test spinbox-1.72 {configuration option: "textvariable"} -setup { } -result {i} test spinbox-1.73 {configuration option: "to"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -850,19 +850,19 @@ test spinbox-1.73 {configuration option: "to"} -setup { destroy .e } -result {14.9} test spinbox-1.74 {configuration option: "to" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -to bogus } -cleanup { destroy .e -} -returnCodes {error} -result {expected floating-point number but got "bogus"} +} -returnCodes error -result {expected floating-point number but got "bogus"} test spinbox-1.75 {configuration option: "validate"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -872,19 +872,19 @@ test spinbox-1.75 {configuration option: "validate"} -setup { destroy .e } -result {key} test spinbox-1.76 {configuration option: "validate" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -validate "bogus" } -cleanup { destroy .e -} -returnCodes {error} -result {bad validate "bogus": must be all, key, focus, focusin, focusout, or none} +} -returnCodes error -result {bad validate "bogus": must be all, key, focus, focusin, focusout, or none} test spinbox-1.77 {configuration option: "validatecommand"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -895,8 +895,8 @@ test spinbox-1.77 {configuration option: "validatecommand"} -setup { } -result {a command} test spinbox-1.78 {configuration option: "values"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -906,19 +906,19 @@ test spinbox-1.78 {configuration option: "values"} -setup { destroy .e } -result {mon tue wed thur} test spinbox-1.79 {configuration option: "values" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -values {bad {}list} } -cleanup { destroy .e -} -returnCodes {error} -result {list element in braces followed by "list" instead of space} +} -returnCodes error -result {list element in braces followed by "list" instead of space} test spinbox-1.80 {configuration option: "validatecommand"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -929,8 +929,8 @@ test spinbox-1.80 {configuration option: "validatecommand"} -setup { } -result {a command} test spinbox-1.81 {configuration option: "width"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -940,19 +940,19 @@ test spinbox-1.81 {configuration option: "width"} -setup { destroy .e } -result 402 test spinbox-1.82 {configuration option: "width" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -width 3p } -cleanup { destroy .e -} -returnCodes {error} -result {expected integer but got "3p"} +} -returnCodes error -result {expected integer but got "3p"} test spinbox-1.83 {configuration option: "wrap"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { @@ -962,19 +962,19 @@ test spinbox-1.83 {configuration option: "wrap"} -setup { destroy .e } -result 1 test spinbox-1.84 {configuration option: "wrap" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken pack .e update } -body { .e configure -wrap xyzzy } -cleanup { destroy .e -} -returnCodes {error} -result {expected boolean value but got "xyzzy"} +} -returnCodes error -result {expected boolean value but got "xyzzy"} test spinbox-1.85 {configuration option: "xscrollcommand"} -setup { spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ - -relief sunken + -relief sunken pack .e update } -body { @@ -2628,12 +2628,12 @@ test spinbox-8.18 {DeleteChars procedure} -setup { set XPAD 1 set buttonWidth [expr { [font measure [.e cget -font] "0"] + 2 * (1 + $XPAD) }] if {$buttonWidth < 11} { - set buttonWidth 11 + set buttonWidth 11 } set expected [expr { [font measure [.e cget -font] "xyy"] \ - + 2 * ( [.e cget -borderwidth] + \ - [.e cget -highlightthickness] + $XPAD ) \ - + $buttonWidth } ] + + 2 * ( [.e cget -borderwidth] + \ + [.e cget -highlightthickness] + $XPAD ) \ + + $buttonWidth } ] expr {[winfo reqwidth .e] == $expected} } -cleanup { destroy .e @@ -2898,7 +2898,7 @@ test spinbox-13.10 {GetSpinboxIndex procedure} -constraints x11 -body { # On unix, when selection is cleared, spinbox widget's internal # selection range is reset. # Previous settings: - spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -2918,11 +2918,11 @@ test spinbox-13.11 {GetSpinboxIndex procedure} -constraints aquaOrWin32 -body { # last selected range. When selection ownership is restored to # spinbox, the old range will be rehighlighted. # Previous settings: - spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e - .e insert 0 012345678901234567890 - .e xview 4 - update + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 1 .e select to 6 list [.e index sel.first] [.e index sel.last] @@ -2936,11 +2936,11 @@ test spinbox-13.11 {GetSpinboxIndex procedure} -constraints aquaOrWin32 -body { test spinbox-13.12 {GetSpinboxIndex procedure} -constraints x11 -body { # Previous settings: - spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e - .e insert 0 012345678901234567890 - .e xview 4 - update + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 1 .e select to 6 list [.e index sel.first] [.e index sel.last] @@ -2953,11 +2953,11 @@ test spinbox-13.12 {GetSpinboxIndex procedure} -constraints x11 -body { test spinbox-13.12.1 {GetSpinboxIndex procedure} -constraints unix -body { # Previous settings: - spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e - .e insert 0 012345678901234567890 - .e xview 4 - update + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 1 .e select to 6 list [.e index sel.first] [.e index sel.last] @@ -2970,11 +2970,11 @@ test spinbox-13.12.1 {GetSpinboxIndex procedure} -constraints unix -body { test spinbox-13.13 {GetSpinboxIndex procedure} -constraints win -body { # Previous settings: - spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e - .e insert 0 012345678901234567890 - .e xview 4 - update + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 1 .e select to 6 list [.e index sel.first] [.e index sel.last] @@ -2990,11 +2990,11 @@ test spinbox-13.14 {GetSpinboxIndex procedure} -constraints win -body { # last selected range. When selection ownership is restored to # spinbox, the old range will be rehighlighted. # Previous settings: - spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e - .e insert 0 012345678901234567890 - .e xview 4 - update + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 1 .e select to 6 list [.e index sel.first] [.e index sel.last] @@ -3010,11 +3010,11 @@ test spinbox-13.14.1 {GetSpinboxIndex procedure} -constraints win -body { # last selected range. When selection ownership is restored to # spinbox, the old range will be rehighlighted. # Previous settings: - spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e - .e insert 0 012345678901234567890 - .e xview 4 - update + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 1 .e select to 6 list [.e index sel.first] [.e index sel.last] @@ -3036,7 +3036,7 @@ test spinbox-13.15 {GetSpinboxIndex procedure} -body { test spinbox-13.16 {GetSpinboxIndex procedure} -constraints fonts -body { spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -3047,7 +3047,7 @@ test spinbox-13.16 {GetSpinboxIndex procedure} -constraints fonts -body { } -result 4 test spinbox-13.17 {GetSpinboxIndex procedure} -constraints fonts -body { spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -3058,7 +3058,7 @@ test spinbox-13.17 {GetSpinboxIndex procedure} -constraints fonts -body { } -result 4 test spinbox-13.18 {GetSpinboxIndex procedure} -constraints fonts -body { spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -3069,7 +3069,7 @@ test spinbox-13.18 {GetSpinboxIndex procedure} -constraints fonts -body { } -result 5 test spinbox-13.19 {GetSpinboxIndex procedure} -constraints fonts -body { spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -3080,7 +3080,7 @@ test spinbox-13.19 {GetSpinboxIndex procedure} -constraints fonts -body { } -result 8 test spinbox-13.20 {GetSpinboxIndex procedure} -constraints fonts -body { spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -3091,7 +3091,7 @@ test spinbox-13.20 {GetSpinboxIndex procedure} -constraints fonts -body { } -result 9 test spinbox-13.21 {GetSpinboxIndex procedure} -body { spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -3111,7 +3111,7 @@ test spinbox-13.22 {GetSpinboxIndex procedure} -setup { } -returnCodes error -result {bad spinbox index "1xyz"} test spinbox-13.23 {GetSpinboxIndex procedure} -body { spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -3122,7 +3122,7 @@ test spinbox-13.23 {GetSpinboxIndex procedure} -body { } -result 0 test spinbox-13.24 {GetSpinboxIndex procedure} -body { spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -3133,7 +3133,7 @@ test spinbox-13.24 {GetSpinboxIndex procedure} -body { } -result 12 test spinbox-13.25 {GetSpinboxIndex procedure} -body { spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -3157,7 +3157,7 @@ test spinbox-14.1 {SpinboxFetchSelection procedure} -body { test spinbox-14.3 {SpinboxFetchSelection procedure} -setup { set x {} for {set i 1} {$i <= 500} {incr i} { - append x "This is line $i, out of 500\n" + append x "This is line $i, out of 500\n" } } -body { spinbox .e @@ -3283,10 +3283,10 @@ test spinbox-19.1 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert 0 a set ::vVals @@ -3298,10 +3298,10 @@ test spinbox-19.2 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert 0 a ;# previous settings .e insert 1 b @@ -3314,10 +3314,10 @@ test spinbox-19.3 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert 0 ab ;# previous settings .e insert end c @@ -3330,10 +3330,10 @@ test spinbox-19.4 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert 0 abc ;# previous settings .e insert 1 123 @@ -3346,10 +3346,10 @@ test spinbox-19.5 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert 0 a123bc ;# previous settings .e delete 2 @@ -3362,10 +3362,10 @@ test spinbox-19.6 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert 0 a13bc ;# previous settings .e configure -validate key @@ -3379,10 +3379,10 @@ test spinbox-19.7 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate focus \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert end abc ;# previous settings set ::vVals {} @@ -3396,10 +3396,10 @@ test spinbox-19.8 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e configure -validate focus ;# previous settings .e insert end abcd ;# previous settings @@ -3415,10 +3415,10 @@ test spinbox-19.9 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate focus \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert end abcd ;# previous settings focus -force .e ;# previous settings @@ -3436,10 +3436,10 @@ test spinbox-19.10 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert end abcd ;# previous settings focus -force .e @@ -3454,10 +3454,10 @@ test spinbox-19.11 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert end abcd ;# previous settings focus -force .e ;# previous settings @@ -3475,10 +3475,10 @@ test spinbox-19.12 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate focusin \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert 0 abcd ;# previous settings focus -force .e @@ -3493,10 +3493,10 @@ test spinbox-19.13 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate focusin \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert end abcd ;# previous settings set ::vVals {} @@ -3512,10 +3512,10 @@ test spinbox-19.14 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate focuso \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert end abcd ;# previous settings set ::vVals {} ;# previous settings @@ -3531,10 +3531,10 @@ test spinbox-19.15 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate focuso \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert end abcd ;# previous settings set ::vVals {} ;# previous settings @@ -3554,10 +3554,10 @@ test spinbox-19.16 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate focuso \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert end abcd ;# previous settings set ::vVals {} ;# previous settings @@ -3577,10 +3577,10 @@ test spinbox-19.17 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate focuso \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e .e insert end abcd ;# previous settings set ::e newdata @@ -3595,10 +3595,10 @@ test spinbox-19.18 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e set ::e newdata ;# previous settings .e configure -validate all @@ -3616,10 +3616,10 @@ test spinbox-19.19 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e set ::e nextdata ;# previous settings @@ -3639,10 +3639,10 @@ test spinbox-19.20 {spinbox widget validation} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white pack .e set ::e nextdata ;# previous settings .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] ;# prev @@ -3664,8 +3664,8 @@ test spinbox-19.21 {spinbox widget validation - bug 40e4bf6198} -setup { unset -nocomplain ::e ::vVals } -body { spinbox .e -validate key \ - -validatecommand [list doval2 %W %d %i %P %s %S %v %V] \ - -textvariable ::e + -validatecommand [list doval2 %W %d %i %P %s %S %v %V] \ + -textvariable ::e pack .e set ::e origdata .e insert 0 A @@ -3707,19 +3707,19 @@ test spinbox-20.5 {spinbox config, -format specifier} -body { .e config -format %2e-1f } -cleanup { destroy .e -} -returnCodes {error} -result {bad spinbox format specifier "%2e-1f"} +} -returnCodes error -result {bad spinbox format specifier "%2e-1f"} test spinbox-20.6 {spinbox config, -format specifier} -body { spinbox .e .e config -format 2.2 } -cleanup { destroy .e -} -returnCodes {error} -result {bad spinbox format specifier "2.2"} +} -returnCodes error -result {bad spinbox format specifier "2.2"} test spinbox-20.7 {spinbox config, -format specifier} -body { spinbox .e .e config -format %2.-2f } -cleanup { destroy .e -} -returnCodes {error} -result {bad spinbox format specifier "%2.-2f"} +} -returnCodes error -result {bad spinbox format specifier "%2.-2f"} test spinbox-20.8 {spinbox config, -format specifier} -body { spinbox .e .e config -format %-2.02f diff --git a/tests/systray.test b/tests/systray.test index a87e6ef..6f38823 100644 --- a/tests/systray.test +++ b/tests/systray.test @@ -14,7 +14,7 @@ test systray-1 {systray icon creation, all options} -setup { image create photo _book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw== } -body { tk systray create -image _book -text "Systray sample" \ - -button1 {puts "button 1 click"} -button3 {puts "button 3 click"} + -button1 {puts "button 1 click"} -button3 {puts "button 3 click"} } -cleanup { tk systray destroy image delete _book @@ -22,17 +22,17 @@ test systray-1 {systray icon creation, all options} -setup { test systray-2 {systray create, argument checking} -body { tk systray create -} -returnCodes {error} -result {missing required option "-image"} +} -returnCodes error -result {missing required option "-image"} test systray-3 {systray create, argument checking} -body { tk systray create -text Hell -} -returnCodes {error} -result {missing required option "-image"} +} -returnCodes error -result {missing required option "-image"} test systray-4 {systray create, argument checking} -setup { image create photo _book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw== } -body { tk systray create -image _book -gorp invalidOption -} -returnCodes {error} -result {unknown option "-gorp": must be -image, -text, -button1 or -button3} +} -returnCodes error -result {unknown option "-gorp": must be -image, -text, -button1 or -button3} test systray-5 {systray icon creation, only required option present} -setup { image create photo _book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw== @@ -94,13 +94,13 @@ test systray-10 {configure non-existing systray icon} -setup { catch {tk systray destroy} } -body { tk systray configure -} -returnCodes {error} -result {systray not created} +} -returnCodes error -result {systray not created} test systray-11 {destroy non-existing systray icon} -setup { catch {tk systray destroy} } -body { tk systray destroy -} -returnCodes {error} -result {systray not created} +} -returnCodes error -result {systray not created} test systray-12 {destroy systray icon works} -setup { image create photo _book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw== @@ -118,7 +118,7 @@ test systray-13 {systray icon creation, attempt to create more than one in an in } -cleanup { tk systray destroy image delete _book -} -returnCodes {error} -result {only one system tray icon supported per interpeter} +} -returnCodes error -result {only one system tray icon supported per interpeter} test systray-14 {systray icon creation, create one per interp, visibiliy checks} -setup { image create photo _book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw== @@ -127,23 +127,23 @@ test systray-14 {systray icon creation, create one per interp, visibiliy checks} interp create second # load Tk into the 'second' interp foreach pkg [info loaded] { - if {[lindex $pkg 1] == "Tk"} { - set loadTk "load $pkg" - break - } + if {[lindex $pkg 1] == "Tk"} { + set loadTk "load $pkg" + break + } } eval $loadTk second # create the icon in the 'second' interp second eval { - # should trigger an error: image _book unknown in 'second' interp' - # image from higer interp should not be visible by 'tk systray' - tk systray create -image _book -text "second interp" + # should trigger an error: image _book unknown in 'second' interp' + # image from higer interp should not be visible by 'tk systray' + tk systray create -image _book -text "second interp" } } -cleanup { tk systray destroy image delete _book interp delete second -} -returnCodes {error} -result {image "_book" doesn't exist} +} -returnCodes error -result {image "_book" does not exist} test systray-15 {systray icon creation, create one per interp} -setup { image create photo _book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw== @@ -152,21 +152,21 @@ test systray-15 {systray icon creation, create one per interp} -setup { interp create second # load Tk into the 'second' interp foreach pkg [info loaded] { - if {[lindex $pkg 1] == "Tk"} { - set loadTk "load $pkg" - break - } + if {[lindex $pkg 1] == "Tk"} { + set loadTk "load $pkg" + break + } } eval $loadTk second # create the icon in the 'second' interp second eval { - image create photo _page -data R0lGODlhCwAPAKIAAP//////AMDAwICAgAAA/wAAAAAAAAAAACwAAAAACwAPAAADMzi6CzAugiAgDGE68aB0RXgRJBFVX0SNpQlUWfahQOvSsgrX7eZJMlQMWBEYj8iQchlKAAA7 - tk systray create -image _page -text "second interp" + image create photo _page -data R0lGODlhCwAPAKIAAP//////AMDAwICAgAAA/wAAAAAAAAAAACwAAAAACwAPAAADMzi6CzAugiAgDGE68aB0RXgRJBFVX0SNpQlUWfahQOvSsgrX7eZJMlQMWBEYj8iQchlKAAA7 + tk systray create -image _page -text "second interp" } } -cleanup { second eval { - tk systray destroy - image delete _page + tk systray destroy + image delete _page } interp delete second tk systray destroy @@ -177,13 +177,13 @@ test systray-16 {systray icon creation from a bitmap, on Linux and macOS only} - nonwin } -setup { set data1 { - #define foo_width 16 - #define foo_height 16 - static unsigned char foo_bits[] = { - 0xff, 0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0xff, 0xff, 0xff, 0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xff, 0xff - }; + #define foo_width 16 + #define foo_height 16 + static unsigned char foo_bits[] = { + 0xff, 0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, + 0x81, 0x81, 0xff, 0xff, 0xff, 0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, + 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xff, 0xff + }; } image create bitmap cross -data $data1 } -body { @@ -227,7 +227,7 @@ test sysnotify-2.1 {system notification stems from a systray icon on Windows} -c catch {tk systray destroy} } -body { tk sysnotify {Alert} {This is an alert} -} -returnCodes {error} -result {must create a system tray icon with the "tk systray" command first} +} -returnCodes error -result {must create a system tray icon with the "tk systray" command first} test sysnotify-2.2 {system notification is not linked to any systray icon on X11 or aqua} -constraints { nonwin } -setup { diff --git a/tests/text.test b/tests/text.test index 2303729..f0fa05d 100644 --- a/tests/text.test +++ b/tests/text.test @@ -46,7 +46,7 @@ test text-1.2 {configuration option: "autoseparators"} -setup { .t configure -autoseparators nah } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.3 {configuration option: "background"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -65,7 +65,7 @@ test text-1.4 {configuration option: "background"} -setup { .t configure -background <gorp> } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.5 {configuration option: "bd"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -84,7 +84,7 @@ test text-1.6 {configuration option: "bd"} -setup { .t configure -bd foo } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.7 {configuration option: "bg"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -103,7 +103,7 @@ test text-1.8 {configuration option: "bg"} -setup { .t configure -bg #xx } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.9 {configuration option: "blockcursor"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -122,7 +122,7 @@ test text-1.10 {configuration option: "blockcursor"} -setup { .t configure -blockcursor xx } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.11 {configuration option: "borderwidth"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -141,7 +141,7 @@ test text-1.12 {configuration option: "borderwidth"} -setup { .t configure -borderwidth ++ } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.13 {configuration option: "cursor"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -160,7 +160,7 @@ test text-1.14 {configuration option: "cursor"} -setup { .t configure -cursor lousy } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.15 {configuration option: "exportselection"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -179,7 +179,7 @@ test text-1.16 {configuration option: "exportselection"} -setup { .t configure -exportselection maybe } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.17 {configuration option: "fg"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -198,7 +198,7 @@ test text-1.18 {configuration option: "fg"} -setup { .t configure -fg stupid } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.19 {configuration option: "font"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -217,7 +217,7 @@ test text-1.20 {configuration option: "font"} -setup { .t configure -font {} } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.21 {configuration option: "foreground"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -236,7 +236,7 @@ test text-1.22 {configuration option: "foreground"} -setup { .t configure -foreground bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.23 {configuration option: "height"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -255,7 +255,7 @@ test text-1.24 {configuration option: "height"} -setup { .t configure -height bad } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.25 {configuration option: "highlightbackground"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -274,7 +274,7 @@ test text-1.26 {configuration option: "highlightbackground"} -setup { .t configure -highlightbackground bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.27 {configuration option: "highlightcolor"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -293,7 +293,7 @@ test text-1.28 {configuration option: "highlightcolor"} -setup { .t configure -highlightcolor bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.29 {configuration option: "highlightthickness"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -312,7 +312,7 @@ test text-1.30 {configuration option: "highlightthickness"} -setup { .t configure -highlightthickness bad } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.31 {configuration option: "inactiveselectbackground"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -331,7 +331,7 @@ test text-1.32 {configuration option: "inactiveselectbackground"} -setup { .t configure -inactiveselectbackground bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.33 {configuration option: "insertbackground"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -350,7 +350,7 @@ test text-1.34 {configuration option: "insertbackground"} -setup { .t configure -insertbackground <bogus> } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.35 {configuration option: "insertborderwidth"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -369,7 +369,7 @@ test text-1.36 {configuration option: "insertborderwidth"} -setup { .t configure -insertborderwidth bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.37 {configuration option: "insertofftime"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -388,7 +388,7 @@ test text-1.38 {configuration option: "insertofftime"} -setup { .t configure -insertofftime 2.4 } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.39 {configuration option: "insertontime"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -407,7 +407,7 @@ test text-1.40 {configuration option: "insertontime"} -setup { .t configure -insertontime e1 } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.41 {configuration option: "insertwidth"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -417,7 +417,7 @@ test text-1.41 {configuration option: "insertwidth"} -setup { .t cget -insertwidth } -cleanup { destroy .t -} -result 2 +} -result 2.3 test text-1.42 {configuration option: "insertwidth"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -426,7 +426,7 @@ test text-1.42 {configuration option: "insertwidth"} -setup { .t configure -insertwidth 47d } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.43 {configuration option: "maxundo"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -454,7 +454,7 @@ test text-1.44 {configuration option: "maxundo"} -setup { .t configure -maxundo noway } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.45 {configuration option: "padx"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -464,7 +464,7 @@ test text-1.45 {configuration option: "padx"} -setup { .t cget -padx } -cleanup { destroy .t -} -result 3 +} -result 3.4 test text-1.46 {configuration option: "padx"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -473,7 +473,7 @@ test text-1.46 {configuration option: "padx"} -setup { .t configure -padx 2.4. } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.47 {configuration option: "pady"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -492,7 +492,7 @@ test text-1.48 {configuration option: "pady"} -setup { .t configure -pady bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.49 {configuration option: "relief"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -511,7 +511,7 @@ test text-1.50 {configuration option: "relief"} -setup { .t configure -relief bumpy } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.51 {configuration option: "selectbackground"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -530,7 +530,7 @@ test text-1.52 {configuration option: "selectbackground"} -setup { .t configure -selectbackground bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.53 {configuration option: "selectborderwidth"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -549,7 +549,7 @@ test text-1.54 {configuration option: "selectborderwidth"} -setup { .t configure -selectborderwidth 3x } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.55 {configuration option: "selectforeground"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -568,7 +568,7 @@ test text-1.56 {configuration option: "selectforeground"} -setup { .t configure -selectforeground #12345 } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.57 {configuration option: "spacing1"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -587,7 +587,7 @@ test text-1.58 {configuration option: "spacing1"} -setup { .t configure -spacing1 1.3x } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.59 {configuration option: "spacing1"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -606,7 +606,7 @@ test text-1.60 {configuration option: "spacing1"} -setup { .t configure -spacing1 bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.61 {configuration option: "spacing2"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -625,7 +625,7 @@ test text-1.62 {configuration option: "spacing2"} -setup { .t configure -spacing2 bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.63 {configuration option: "spacing2"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -644,7 +644,7 @@ test text-1.64 {configuration option: "spacing2"} -setup { .t configure -spacing2 bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.65 {configuration option: "spacing3"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -663,7 +663,7 @@ test text-1.66 {configuration option: "spacing3"} -setup { .t configure -spacing3 bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.67 {configuration option: "spacing3"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -682,7 +682,7 @@ test text-1.68 {configuration option: "spacing3"} -setup { .t configure -spacing3 bogus } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.69 {configuration option: "state"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -701,7 +701,7 @@ test text-1.70 {configuration option: "state"} -setup { .t configure -state foo } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.71 {configuration option: "tabs"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -720,7 +720,7 @@ test text-1.72 {configuration option: "tabs"} -setup { .t configure -tabs bad_tabs } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.73 {configuration option: "tabstyle"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -739,7 +739,7 @@ test text-1.74 {configuration option: "tabstyle"} -setup { .t configure -tabstyle garbage } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.75 {configuration option: "undo"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -767,7 +767,7 @@ test text-1.76 {configuration option: "undo"} -setup { .t configure -undo eh } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.77 {configuration option: "width"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -786,7 +786,7 @@ test text-1.78 {configuration option: "width"} -setup { .t configure -width 2.4 } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.79 {configuration option: "wrap"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -805,7 +805,7 @@ test text-1.80 {configuration option: "wrap"} -setup { .t configure -wrap bad_wrap } -cleanup { destroy .t -} -match glob -returnCodes {error} -result {*} +} -match glob -returnCodes error -result {*} test text-1.81 {text options} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -879,15 +879,15 @@ test text-1.86 {configuration option: "insertunfocussed"} -setup { test text-2.1 {Tk_TextCmd procedure} -body { text -} -returnCodes {error} -result {wrong # args: should be "text pathName ?-option value ...?"} +} -returnCodes error -result {wrong # args: should be "text pathName ?-option value ...?"} test text-2.2 {Tk_TextCmd procedure} -body { text foobar -} -returnCodes {error} -result {bad window path name "foobar"} +} -returnCodes error -result {bad window path name "foobar"} test text-2.3 {Tk_TextCmd procedure} -body { text .t -gorp nofun } -cleanup { destroy .t -} -returnCodes {error} -result {unknown option "-gorp"} +} -returnCodes error -result {unknown option "-gorp"} test text-2.4 {Tk_TextCmd procedure} -body { catch {text .t -gorp nofun} winfo exists .t @@ -945,14 +945,14 @@ test text-3.1 {TextWidgetCmd procedure, basics} -setup { .t } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t option ?arg ...?"} +} -returnCodes error -result {wrong # args: should be ".t option ?arg ...?"} test text-3.2 {TextWidgetCmd procedure} -setup { text .t } -body { .t gorp 1.0 z 1.2 } -cleanup { destroy .t -} -returnCodes {error} -result {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview} +} -returnCodes error -result {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview} test text-4.1 {TextWidgetCmd procedure, "bbox" option} -setup { text .t @@ -960,21 +960,21 @@ test text-4.1 {TextWidgetCmd procedure, "bbox" option} -setup { .t bbox } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t bbox index"} +} -returnCodes error -result {wrong # args: should be ".t bbox index"} test text-4.2 {TextWidgetCmd procedure, "bbox" option} -setup { text .t } -body { .t bbox a b } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t bbox index"} +} -returnCodes error -result {wrong # args: should be ".t bbox index"} test text-4.3 {TextWidgetCmd procedure, "bbox" option} -setup { text .t } -body { .t bbox bad_mark } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "bad_mark"} +} -returnCodes error -result {bad text index "bad_mark"} test text-5.1 {TextWidgetCmd procedure, "cget" option} -setup { text .t @@ -982,21 +982,21 @@ test text-5.1 {TextWidgetCmd procedure, "cget" option} -setup { .t cget } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t cget option"} +} -returnCodes error -result {wrong # args: should be ".t cget option"} test text-5.2 {TextWidgetCmd procedure, "cget" option} -setup { text .t } -body { .t cget a b } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t cget option"} +} -returnCodes error -result {wrong # args: should be ".t cget option"} test text-5.3 {TextWidgetCmd procedure, "cget" option} -setup { text .t } -body { .t cget -gorp } -cleanup { destroy .t -} -returnCodes {error} -result {unknown option "-gorp"} +} -returnCodes error -result {unknown option "-gorp"} test text-5.4 {TextWidgetCmd procedure, "cget" option} -setup { text .t } -body { @@ -1013,28 +1013,28 @@ test text-6.1 {TextWidgetCmd procedure, "compare" option} -setup { .t compare a b } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t compare index1 op index2"} +} -returnCodes error -result {wrong # args: should be ".t compare index1 op index2"} test text-6.2 {TextWidgetCmd procedure, "compare" option} -setup { text .t } -body { .t compare a b c d } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t compare index1 op index2"} +} -returnCodes error -result {wrong # args: should be ".t compare index1 op index2"} test text-6.3 {TextWidgetCmd procedure, "compare" option} -setup { text .t } -body { .t compare @x == 1.0 } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "@x"} +} -returnCodes error -result {bad text index "@x"} test text-6.4 {TextWidgetCmd procedure, "compare" option} -setup { text .t } -body { .t compare 1.0 < @y } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "@y"} +} -returnCodes error -result {bad text index "@y"} test text-6.5 {TextWidgetCmd procedure, "compare" option} -setup { text .t } -body { @@ -1132,7 +1132,7 @@ Line 7" .t compare 1.0 <x 1.2 } -cleanup { destroy .t -} -returnCodes {error} -result {bad comparison operator "<x": must be <, <=, ==, >=, >, or !=} +} -returnCodes error -result {bad comparison operator "<x": must be <, <=, ==, >=, >, or !=} test text-6.12 {TextWidgetCmd procedure, "compare" option} -setup { text .t } -body { @@ -1146,7 +1146,7 @@ Line 7" .t compare 1.0 >> 1.2 } -cleanup { destroy .t -} -returnCodes {error} -result {bad comparison operator ">>": must be <, <=, ==, >=, >, or !=} +} -returnCodes error -result {bad comparison operator ">>": must be <, <=, ==, >=, >, or !=} test text-6.13 {TextWidgetCmd procedure, "compare" option} -setup { text .t } -body { @@ -1160,7 +1160,7 @@ Line 7" .t compare 1.0 z 1.2 } -cleanup { destroy .t -} -returnCodes {error} -result {bad comparison operator "z": must be <, <=, ==, >=, >, or !=} +} -returnCodes error -result {bad comparison operator "z": must be <, <=, ==, >=, >, or !=} test text-6.14 {TextWidgetCmd procedure, "compare" option} -setup { text .t } -body { @@ -1174,7 +1174,7 @@ Line 7" .t co 1.0 z 1.2 } -cleanup { destroy .t -} -returnCodes {error} -result {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview} +} -returnCodes error -result {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview} # "configure" option is already covered above test text-7.1 {TextWidgetCmd procedure, "debug" option} -setup { @@ -1183,14 +1183,14 @@ test text-7.1 {TextWidgetCmd procedure, "debug" option} -setup { .t debug 0 1 } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t debug boolean"} +} -returnCodes error -result {wrong # args: should be ".t debug boolean"} test text-7.2 {TextWidgetCmd procedure, "debug" option} -setup { text .t } -body { .t de 0 1 } -cleanup { destroy .t -} -returnCodes {error} -result {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview} +} -returnCodes error -result {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview} test text-7.3 {TextWidgetCmd procedure, "debug" option} -setup { text .t } -body { @@ -1215,21 +1215,21 @@ test text-8.1 {TextWidgetCmd procedure, "delete" option} -setup { .t delete } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t delete index1 ?index2 ...?"} +} -returnCodes error -result {wrong # args: should be ".t delete index1 ?index2 ...?"} test text-8.2 {TextWidgetCmd procedure, "delete" option} -setup { text .t } -body { .t delete a b c } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "a"} +} -returnCodes error -result {bad text index "a"} test text-8.3 {TextWidgetCmd procedure, "delete" option} -setup { text .t } -body { .t delete @x 2.2 } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "@x"} +} -returnCodes error -result {bad text index "@x"} test text-8.4 {TextWidgetCmd procedure, "delete" option} -setup { text .t } -body { @@ -1239,7 +1239,7 @@ abcdefghijklm .t delete 2.3 @y } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "@y"} +} -returnCodes error -result {bad text index "@y"} test text-8.5 {TextWidgetCmd procedure, "delete" option} -setup { text .t } -body { @@ -1296,7 +1296,7 @@ abcdefghijklm .t delete 2.1 2.3 foo } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "foo"} +} -returnCodes error -result {bad text index "foo"} test text-8.9 {TextWidgetCmd procedure, "delete" option} -setup { text .t } -body { @@ -1414,7 +1414,7 @@ abcdefghijklm .t replace 1.3 2.3 } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t replace index1 index2 chars ?tagList chars tagList ...?"} +} -returnCodes error -result {wrong # args: should be ".t replace index1 index2 chars ?tagList chars tagList ...?"} test text-8.19 {TextWidgetCmd procedure, "replace" option} -setup { text .t } -body { @@ -1424,7 +1424,7 @@ abcdefghijklm .t replace 3.1 2.3 foo } -cleanup { destroy .t -} -returnCodes {error} -result {index "2.3" before "3.1" in the text} +} -returnCodes error -result {index "2.3" before "3.1" in the text} test text-8.20 {TextWidgetCmd procedure, "replace" option} -setup { text .t } -body { @@ -1486,17 +1486,17 @@ Line 7" rename test.t .t destroy .t } -result [list {edit undo} {delete 2.1 2.4} {mark set insert 2.1} {see insert} \ - {mark set tk::undoMarkL2 2.1} {mark set tk::undoMarkR2 2.4} \ - {mark gravity tk::undoMarkL2 left} {mark gravity tk::undoMarkR2 right} \ - {insert 2.1 ef} {mark set insert 2.3} {see insert} \ - {mark set tk::undoMarkL1 2.1} {mark set tk::undoMarkR1 2.3} \ - {mark gravity tk::undoMarkL1 left} {mark gravity tk::undoMarkR1 right} \ - {mark names} \ - {index tk::undoMarkL1} {index tk::undoMarkR1} \ - {mark unset tk::undoMarkL1 tk::undoMarkR1} \ - {index tk::undoMarkL2} {index tk::undoMarkR2} \ - {mark unset tk::undoMarkL2 tk::undoMarkR2} \ - {compare 2.1 > 2.3} {compare 2.6 > 2.3} ] + {mark set tk::undoMarkL2 2.1} {mark set tk::undoMarkR2 2.4} \ + {mark gravity tk::undoMarkL2 left} {mark gravity tk::undoMarkR2 right} \ + {insert 2.1 ef} {mark set insert 2.3} {see insert} \ + {mark set tk::undoMarkL1 2.1} {mark set tk::undoMarkR1 2.3} \ + {mark gravity tk::undoMarkL1 left} {mark gravity tk::undoMarkR1 right} \ + {mark names} \ + {index tk::undoMarkL1} {index tk::undoMarkR1} \ + {mark unset tk::undoMarkL1 tk::undoMarkR1} \ + {index tk::undoMarkL2} {index tk::undoMarkR2} \ + {mark unset tk::undoMarkL2 tk::undoMarkR2} \ + {compare 2.1 > 2.3} {compare 2.6 > 2.3} ] test text-8.23 {TextWidgetCmd procedure, "replace" option with undo} -setup { text .t @@ -1594,7 +1594,7 @@ test text-8.27 {TextWidgetCmd procedure, "replace" option crash} -setup { } -body { .tt insert 0.0 \na for {set i 0} {$i < 2} {incr i} { - .tt replace 2.0 3.0 b + .tt replace 2.0 3.0 b } } -cleanup { destroy .tt @@ -1616,28 +1616,28 @@ test text-9.1 {TextWidgetCmd procedure, "get" option} -setup { .t get } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t get ?-displaychars? ?--? index1 ?index2 ...?"} +} -returnCodes error -result {wrong # args: should be ".t get ?-displaychars? ?--? index1 ?index2 ...?"} test text-9.2 {TextWidgetCmd procedure, "get" option} -setup { text .t } -body { .t get a b c } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "a"} +} -returnCodes error -result {bad text index "a"} test text-9.3 {TextWidgetCmd procedure, "get" option} -setup { text .t } -body { .t get @q 3.1 } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "@q"} +} -returnCodes error -result {bad text index "@q"} test text-9.4 {TextWidgetCmd procedure, "get" option} -setup { text .t } -body { .t get 3.1 @r } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "@r"} +} -returnCodes error -result {bad text index "@r"} test text-9.5 {TextWidgetCmd procedure, "get" option} -setup { text .t } -body { @@ -1867,7 +1867,7 @@ Line 7" .t get 5.2 5.4 5.5 foo } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "foo"} +} -returnCodes error -result {bad text index "foo"} test text-9.21 {TextWidgetCmd procedure, "get" option} -setup { text .t } -body { @@ -2061,35 +2061,35 @@ test text-10.1 {TextWidgetCmd procedure, "count" option} -setup { .t count } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t count ?-option value ...? index1 index2"} +} -returnCodes error -result {wrong # args: should be ".t count ?-option value ...? index1 index2"} test text-10.2 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { .t count blah 1.0 2.0 } -cleanup { destroy .t -} -returnCodes {error} -result {bad option "blah": must be -chars, -displaychars, -displayindices, -displaylines, -indices, -lines, -update, -xpixels, or -ypixels} +} -returnCodes error -result {bad option "blah": must be -chars, -displaychars, -displayindices, -displaylines, -indices, -lines, -update, -xpixels, or -ypixels} test text-10.3 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { .t count a b } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "a"} +} -returnCodes error -result {bad text index "a"} test text-10.4 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { .t count @q 3.1 } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "@q"} +} -returnCodes error -result {bad text index "@q"} test text-10.5 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { .t count 3.1 @r } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "@r"} +} -returnCodes error -result {bad text index "@r"} test text-10.6 {TextWidgetCmd procedure, "count" option} -setup { text .t .t insert 1.0 "Line 1 @@ -2187,7 +2187,7 @@ Line 7" .t count 5.2 foo } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "foo"} +} -returnCodes error -result {bad text index "foo"} test text-10.13 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2608,7 +2608,7 @@ test text-10.32 {TextWidgetCmd procedure, "count" option} -setup { .t count -lines 1.0 2.0 3.0 } -cleanup { destroy .t -} -returnCodes {error} -result {bad option "1.0": must be -chars, -displaychars, -displayindices, -displaylines, -indices, -lines, -update, -xpixels, or -ypixels} +} -returnCodes error -result {bad option "1.0": must be -chars, -displaychars, -displayindices, -displaylines, -indices, -lines, -update, -xpixels, or -ypixels} test text-10.33 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2736,7 +2736,7 @@ test text-10.42 {TextWidgetCmd procedure, "count" option} -setup { set res {} } -body { for {set i 1} {$i < 25} {incr i} { - .t insert end "Line $i\n" + .t insert end "Line $i\n" } .t tag configure hidden -elide true .t tag add hidden 5.7 11.0 @@ -2957,7 +2957,7 @@ test text-11a.2 {TextWidgetCmd procedure, "pendingsync" option} -setup { update set content {} for {set i 1} {$i < 300} {incr i} { - append content [string repeat "$i " 15] \n + append content [string repeat "$i " 15] \n } .top.yt insert 1.0 $content # wait for end of line metrics calculation to get correct $fraction1 @@ -2996,7 +2996,7 @@ test text-11a.12 {TextWidgetCmd procedure, "sync" option} -setup { set content {} # Use long lines so the line metrics will need updating. for {set i 1} {$i < 30} {incr i} { - append content [string repeat "$i " 200] \n + append content [string repeat "$i " 200] \n } .top.yt insert 1.0 $content # wait for end of line metrics calculation to get correct $fraction1 @@ -3040,7 +3040,7 @@ test text-11a.22 {TextWidgetCmd procedure, "sync" option with -command} -setup { update set content {} for {set i 1} {$i < 30} {incr i} { - append content [string repeat "$i " 15] \n + append content [string repeat "$i " 15] \n } .top.yt insert 1.0 $content # first case: line metrics calculation still running when launching 'sync -command' @@ -3067,7 +3067,7 @@ test text-11a.31 {"<<WidgetViewSync>>" event} -setup { update set content {} for {set i 1} {$i < 300} {incr i} { - append content [string repeat "$i " 15] \n + append content [string repeat "$i " 15] \n } # Sync the widget and process <<WidgetViewSync>> events before binding. .top.yt sync @@ -3099,7 +3099,7 @@ test text-11a.41 {"sync" "pendingsync" and <<WidgetViewSync>>} -setup { update set content {} for {set i 1} {$i < 300} {incr i} { - append content [string repeat "$i " 50] \n + append content [string repeat "$i " 50] \n } # Sync the widget and process all <<WidgetViewSync>> events before binding. .top.yt sync @@ -3123,8 +3123,8 @@ test text-11a.41 {"sync" "pendingsync" and <<WidgetViewSync>>} -setup { } -result {Sync:0 Pending:1 Sync:1 Pending:0} test text-11a.51 {<<WidgetViewSync>> calls Tk_SendVirtualEvent(), - NOT Tk_HandleEvent(). - Bug [b362182e45704dd7bbd6aed91e48122035ea3d16]} -setup { + NOT Tk_HandleEvent(). + Bug [b362182e45704dd7bbd6aed91e48122035ea3d16]} -setup { destroy .top.t .top } -body { set res {} @@ -3132,7 +3132,7 @@ test text-11a.51 {<<WidgetViewSync>> calls Tk_SendVirtualEvent(), pack [text .top.t] update for {set i 1} {$i < 10000} {incr i} { - .top.t insert end "Hello world!\n" + .top.t insert end "Hello world!\n" } bind .top.t <<WidgetViewSync>> {destroy .top.t} .top.t tag add mytag 1.5 8000.8 ; # shall not crash @@ -3148,28 +3148,28 @@ test text-12.1 {TextWidgetCmd procedure, "index" option} -setup { .t index } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t index index"} +} -returnCodes error -result {wrong # args: should be ".t index index"} test text-12.2 {TextWidgetCmd procedure, "index" option} -setup { text .t } -body { .t ind a b } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t index index"} +} -returnCodes error -result {wrong # args: should be ".t index index"} test text-12.3 {TextWidgetCmd procedure, "index" option} -setup { text .t } -body { .t in a b } -cleanup { destroy .t -} -returnCodes {error} -result {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview} +} -returnCodes error -result {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview} test text-12.4 {TextWidgetCmd procedure, "index" option} -setup { text .t } -body { .t index @xyz } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "@xyz"} +} -returnCodes error -result {bad text index "@xyz"} test text-12.5 {TextWidgetCmd procedure, "index" option} -setup { [text .t] insert 1.0 "Line 1 aefghijklm @@ -3197,7 +3197,7 @@ Line 7" .t insert 1.2 } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t insert index chars ?tagList chars tagList ...?"} +} -returnCodes error -result {wrong # args: should be ".t insert index chars ?tagList chars tagList ...?"} test text-13.2 {TextWidgetCmd procedure, "insert" option} -setup { text .t } -body { @@ -3277,7 +3277,7 @@ test text-13.8 {TextWidgetCmd procedure, "insert" option} -setup { .t insert 1.0 "Sample text" "a \{b" } -cleanup { destroy .t -} -returnCodes {error} -result {unmatched open brace in list} +} -returnCodes error -result {unmatched open brace in list} test text-13.9 {TextWidgetCmd procedure, "insert" option} -setup { text .t } -body { @@ -3304,7 +3304,7 @@ test text-14.1 {ConfigureText procedure} -setup { .t configure -state foobar } -cleanup { destroy .t -} -returnCodes {error} -result {bad state "foobar": must be disabled or normal} +} -returnCodes error -result {bad state "foobar": must be disabled or normal} test text-14.2 {ConfigureText procedure} -setup { text .t } -body { @@ -3335,7 +3335,7 @@ test text-14.5 {ConfigureText procedure} -setup { .t configure -tabs {30 foo} } -cleanup { destroy .t -} -returnCodes {error} -result {bad tab alignment "foo": must be left, right, center, or numeric} +} -returnCodes error -result {bad tab alignment "foo": must be left, right, center, or numeric} test text-14.6 {ConfigureText procedure} -setup { text .t } -body { @@ -3363,7 +3363,7 @@ test text-14.8 {ConfigureText procedure} -setup { .t configure -wrap bogus } -cleanup { destroy .t -} -returnCodes {error} -result {bad wrap "bogus": must be char, none, or word} +} -returnCodes error -result {bad wrap "bogus": must be char, none, or word} test text-14.9 {ConfigureText procedure} -setup { text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2 } -body { @@ -3378,18 +3378,18 @@ test text-14.9 {ConfigureText procedure} -setup { test text-14.10 {ConfigureText procedure} -setup { text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2 } -body { - .t configure -selectborderwidth {} + .t configure -selectborderwidth 0 .t tag cget sel -borderwidth } -cleanup { destroy .t -} -result {} +} -result 0 test text-14.11 {ConfigureText procedure} -setup { text .t } -body { .t configure -selectborderwidth foo } -cleanup { destroy .t -} -returnCodes {error} -result {expected screen distance or "" but got "foo"} +} -returnCodes error -result {expected screen distance but got "foo"} test text-14.12 {ConfigureText procedure} -body { text .t entry .t.e @@ -3691,13 +3691,13 @@ test text-19.2 {DeleteChars procedure} -body { .t delete foobar } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "foobar"} +} -returnCodes error -result {bad text index "foobar"} test text-19.3 {DeleteChars procedure} -body { text .t .t delete 1.0 lousy } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "lousy"} +} -returnCodes error -result {bad text index "lousy"} test text-19.4 {DeleteChars procedure} -body { text .t .t insert 1.0 "Line 1 @@ -3895,7 +3895,7 @@ test text-20.1 {TextFetchSelection procedure} -setup { update } -body { foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} { - .t insert end $i.0$i.1$i.2$i.3$i.4\n + .t insert end $i.0$i.1$i.2$i.3$i.4\n } .t tag add sel 1.3 3.4 selection get @@ -3910,7 +3910,7 @@ test text-20.2 {TextFetchSelection procedure} -setup { update } -body { foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} { - .t insert end $i.0$i.1$i.2$i.3$i.4\n + .t insert end $i.0$i.1$i.2$i.3$i.4\n } .t tag add x 1.2 .t tag add x 1.4 @@ -3930,7 +3930,7 @@ test text-20.3 {TextFetchSelection procedure} -setup { update } -body { foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} { - .t insert end $i.0$i.1$i.2$i.3$i.4\n + .t insert end $i.0$i.1$i.2$i.3$i.4\n } .t tag remove sel 1.0 end .t tag add sel 13.3 @@ -3944,7 +3944,7 @@ test text-20.4 {TextFetchSelection procedure} -setup { update } -body { foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} { - .t insert end $i.0$i.1$i.2$i.3$i.4\n + .t insert end $i.0$i.1$i.2$i.3$i.4\n } .t tag remove x 1.0 end .t tag add sel 1.0 3.4 @@ -3965,7 +3965,7 @@ test text-20.5 {TextFetchSelection procedure, long selections} -setup { set x "" } -body { for {set i 1} {$i < 200} {incr i} { - append x "This is line $i, padded to just about 53 characters.\n" + append x "This is line $i, padded to just about 53 characters.\n" } .t insert end $x .t tag add sel 1.0 end @@ -4084,7 +4084,7 @@ test text-22.8 {TextSearchCmd procedure, -count option} -body { .t search -count } -cleanup { destroy .t -} -returnCodes {error} -result {no value given for "-count" option} +} -returnCodes error -result {no value given for "-count" option} test text-22.9 {TextSearchCmd procedure, -nocase option} -body { text .t .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx" @@ -4112,7 +4112,7 @@ test text-22.12 {TextSearchCmd procedure, -nolinestop option} -body { .t search -nolinestop BaR 1.1 } -cleanup { destroy .t -} -returnCodes {error} -result {the "-nolinestop" option requires the "-regexp" option to be present} +} -returnCodes error -result {the "-nolinestop" option requires the "-regexp" option to be present} test text-22.13 {TextSearchCmd procedure, -nolinestop option} -body { text .t .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx" @@ -4134,20 +4134,20 @@ test text-22.15 {TextSearchCmd procedure, argument parsing} -body { .t search abc } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t search ?switches? pattern index ?stopIndex?"} +} -returnCodes error -result {wrong # args: should be ".t search ?switches? pattern index ?stopIndex?"} test text-22.16 {TextSearchCmd procedure, argument parsing} -body { text .t .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx" .t search abc d e f } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t search ?switches? pattern index ?stopIndex?"} +} -returnCodes error -result {wrong # args: should be ".t search ?switches? pattern index ?stopIndex?"} test text-22.17 {TextSearchCmd procedure, check index} -body { text .t .t search abc gorp } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "gorp"} +} -returnCodes error -result {bad text index "gorp"} test text-22.18 {TextSearchCmd procedure, startIndex == "end"} -body { text .t .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx" @@ -4168,7 +4168,7 @@ test text-22.20 {TextSearchCmd procedure, bad stopIndex} -body { .t search abc 1.0 lousy } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "lousy"} +} -returnCodes error -result {bad text index "lousy"} test text-22.21 {TextSearchCmd procedure, pattern case conversion} -body { text .t .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx" @@ -4182,7 +4182,7 @@ test text-22.22 {TextSearchCmd procedure, bad regular expression pattern} -body .t search -regexp a( 1.0 } -cleanup { destroy .t -} -returnCodes {error} -result {couldn't compile regular expression pattern: parentheses () not balanced} +} -returnCodes error -result {cannot compile regular expression pattern: parentheses () not balanced} test text-22.23 {TextSearchCmd procedure, skip dummy last line} -body { text .t .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx" @@ -4486,7 +4486,7 @@ test text-22.56 {TextSearchCmd procedure, error setting variable} -body { .t search -count a(2) xyz 1.0 } -cleanup { destroy .t -} -returnCodes {error} -result {can't set "a(2)": variable isn't array} +} -returnCodes error -result {can't set "a(2)": variable isn't array} test text-22.57 {TextSearchCmd procedure, wrap-around} -body { text .t .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx" @@ -6117,7 +6117,7 @@ test text-23.1 {TkTextGetTabs procedure} -setup { .t configure -tabs "\{{}" } -cleanup { destroy .t -} -returnCodes {error} -result {unmatched open brace in list} +} -returnCodes error -result {unmatched open brace in list} test text-23.2 {TkTextGetTabs procedure} -setup { text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 150 pack .t @@ -6126,7 +6126,7 @@ test text-23.2 {TkTextGetTabs procedure} -setup { .t configure -tabs xyz } -cleanup { destroy .t -} -returnCodes {error} -result {expected screen distance but got "xyz"} +} -returnCodes error -result {expected screen distance but got "xyz"} test text-23.3 {TkTextGetTabs procedure} -setup { text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 150 pack .t @@ -6174,7 +6174,7 @@ test text-23.6 {TkTextGetTabs procedure} -setup { .t configure -tabs {100 left 200 lork} } -cleanup { destroy .t -} -returnCodes {error} -result {bad tab alignment "lork": must be left, right, center, or numeric} +} -returnCodes error -result {bad tab alignment "lork": must be left, right, center, or numeric} test text-23.7 {TkTextGetTabs procedure} -setup { text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 150 pack .t @@ -6183,7 +6183,7 @@ test text-23.7 {TkTextGetTabs procedure} -setup { .t configure -tabs {100 !44 200 lork} } -cleanup { destroy .t -} -returnCodes {error} -result {expected screen distance but got "!44"} +} -returnCodes error -result {expected screen distance but got "!44"} test text-24.1 {TextDumpCmd procedure, bad args} -body { @@ -6193,7 +6193,7 @@ test text-24.1 {TextDumpCmd procedure, bad args} -body { .t dump } -cleanup { destroy .t -} -returnCodes {error} -result {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?} +} -returnCodes error -result {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?} test text-24.2 {TextDumpCmd procedure, bad args} -body { pack [text .t] .t insert 1.0 "One Line" @@ -6201,7 +6201,7 @@ test text-24.2 {TextDumpCmd procedure, bad args} -body { .t dump -all } -cleanup { destroy .t -} -returnCodes {error} -result {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?} +} -returnCodes error -result {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?} test text-24.3 {TextDumpCmd procedure, bad args} -body { pack [text .t] .t insert 1.0 "One Line" @@ -6209,7 +6209,7 @@ test text-24.3 {TextDumpCmd procedure, bad args} -body { .t dump -command } -cleanup { destroy .t -} -returnCodes {error} -result {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?} +} -returnCodes error -result {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?} test text-24.4 {TextDumpCmd procedure, bad args} -body { pack [text .t] .t insert 1.0 "One Line" @@ -6217,7 +6217,7 @@ test text-24.4 {TextDumpCmd procedure, bad args} -body { .t dump -bogus } -cleanup { destroy .t -} -returnCodes {error} -result {bad option "-bogus": must be -all, -command, -image, -mark, -tag, -text, or -window} +} -returnCodes error -result {bad option "-bogus": must be -all, -command, -image, -mark, -tag, -text, or -window} test text-24.5 {TextDumpCmd procedure, bad args} -body { pack [text .t] .t insert 1.0 "One Line" @@ -6225,7 +6225,7 @@ test text-24.5 {TextDumpCmd procedure, bad args} -body { .t dump bogus } -cleanup { destroy .t -} -returnCodes {error} -result {bad text index "bogus"} +} -returnCodes error -result {bad text index "bogus"} test text-24.6 {TextDumpCmd procedure, one index} -body { pack [text .t] .t insert 1.0 "One Line" @@ -6392,8 +6392,8 @@ test text-24.23 {TextDumpCmd procedure, command script} -setup { set x {} pack [text .t] proc Append {varName key value index} { - upvar #0 $varName x - lappend x $key $index $value + upvar #0 $varName x + lappend x $key $index $value } } -body { .t insert end "Line One\nLine Two\nLine Three\nLine Four" @@ -6415,8 +6415,8 @@ test text-24.24 {TextDumpCmd procedure, command script} -setup { set x {} pack [text .t] proc Append {varName key value index} { - upvar #0 $varName x - lappend x $key $index $value + upvar #0 $varName x + lappend x $key $index $value } } -body { .t insert end "Line One\nLine Two\nLine Three\nLine Four" @@ -6481,13 +6481,13 @@ test text-27.1 {TextEditCmd procedure, argument parsing} -body { .t edit } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t edit option ?arg ...?"} +} -returnCodes error -result {wrong # args: should be ".t edit option ?arg ...?"} test text-27.2 {TextEditCmd procedure, argument parsing} -body { pack [text .t] .t edit gorp } -cleanup { destroy .t -} -returnCodes {error} -result {bad edit option "gorp": must be canundo, canredo, modified, redo, reset, separator, or undo} +} -returnCodes error -result {bad edit option "gorp": must be canundo, canredo, modified, redo, reset, separator, or undo} test text-27.3 {TextEditUndo procedure, undoing changes} -body { text .t -undo 1 pack .t @@ -7004,27 +7004,27 @@ test text-27.26 {edit undo and edit redo return ranges} -setup { } -cleanup { destroy .t } -result [list {1.6 2.0} \ - {1.6 2.19} \ - {1.6 1.7 1.10 1.12} \ - {1.6 1.7 1.9 1.11} \ - {1.6 1.16 2.8 2.19} \ - {1.6 1.16 2.8 2.30} ] + {1.6 2.19} \ + {1.6 1.7 1.10 1.12} \ + {1.6 1.7 1.9 1.11} \ + {1.6 1.16 2.8 2.19} \ + {1.6 1.16 2.8 2.30} ] test text-27.27 {edit undo and edit redo return ranges} -setup { destroy .t set res {} } -body { text .t -undo true -autoseparators false for {set i 3} {$i >= 1} {incr i -1} { - .t insert 1.0 "Line $i\n" + .t insert 1.0 "Line $i\n" } lappend res [.t edit undo] lappend res [.t edit redo] } -cleanup { destroy .t } -result [list {1.0 2.0} \ - {1.0 4.0} ] + {1.0 4.0} ] test text-27.28 {edit undo and edit redo do not leave \ - spurious temporary marks behind them} -setup { + spurious temporary marks behind them} -setup { destroy .t set res {} } -body { @@ -7068,13 +7068,13 @@ test text-29.1 {tabs - must be positive and must be increasing} -body { .t configure -tabs 0 } -cleanup { destroy .t -} -returnCodes {error} -result {tab stop "0" is not at a positive distance} +} -returnCodes error -result {tab stop "0" is not at a positive distance} test text-29.2 {tabs - must be positive and must be increasing} -body { pack [text .t -wrap none] .t configure -tabs -5 } -cleanup { destroy .t -} -returnCodes {error} -result {tab stop "-5" is not at a positive distance} +} -returnCodes error -result {tab stop "-5" is not at a positive distance} test text-29.3 {tabs - must be positive and must be increasing} -constraints { knownBug } -body { @@ -7084,7 +7084,7 @@ test text-29.3 {tabs - must be positive and must be increasing} -constraints { .t configure -tabs {10c 5c} } -cleanup { destroy .t -} -returnCodes {error} -result {tabs must be monotonically increasing, but "5c" is smaller than or equal to the previous tab} +} -returnCodes error -result {tabs must be monotonically increasing, but "5c" is smaller than or equal to the previous tab} test text-29.4 {tabs - must be positive and must be increasing} -body { pack [text .t -wrap none] .t insert end "a\tb\tc\td\te" @@ -7100,8 +7100,8 @@ test text-29.4 {tabs - must be positive and must be increasing} -body { test text-30.1 {repeated insert and scroll} -body { pack [text .t] for {set i 0} {$i < 30} {incr i} { - .t insert end "blabla\n" - eval .t yview moveto 1 + .t insert end "blabla\n" + eval .t yview moveto 1 } # This test must simply not crash to succeed set result 1 @@ -7111,8 +7111,8 @@ test text-30.1 {repeated insert and scroll} -body { test text-30.2 {repeated insert and scroll} -body { pack [text .t] for {set i 0} {$i < 30} {incr i} { - .t insert end "blabla\n" - eval .t yview scroll 1 pages + .t insert end "blabla\n" + eval .t yview scroll 1 pages } # This test must simply not crash to succeed set result 1 @@ -7122,8 +7122,8 @@ test text-30.2 {repeated insert and scroll} -body { test text-30.3 {repeated insert and scroll} -body { pack [text .t] for {set i 0} {$i < 30} {incr i} { - .t insert end "blabla\n" - eval .t yview scroll 100 pixels + .t insert end "blabla\n" + eval .t yview scroll 100 pixels } # This test must simply not crash to succeed set result 1 @@ -7133,8 +7133,8 @@ test text-30.3 {repeated insert and scroll} -body { test text-30.4 {repeated insert and scroll} -body { pack [text .t] for {set i 0} {$i < 30} {incr i} { - .t insert end "blabla\n" - eval .t yview scroll 10 units + .t insert end "blabla\n" + eval .t yview scroll 10 units } # This test must simply not crash to succeed set result 1 @@ -7260,8 +7260,8 @@ test text-31.9 {peer widgets} -body { test text-31.10 {peer widgets} -body { toplevel .top pack [text .t] - for {set i 1} {$i < 20} {incr i} { - .t insert end "Line $i\n" + for {set i 1} {$i < 20} {incr i} { + .t insert end "Line $i\n" } pack [.t peer create .top.t -startline 5 -endline 11] update ; update @@ -7275,7 +7275,7 @@ test text-31.11 {peer widgets} -setup { set res {} } -body { for {set i 1} {$i < 100} {incr i} { - .t insert end "Line $i\n" + .t insert end "Line $i\n" } .t tag add sel 1.0 end-1c lappend res [.t tag ranges sel] @@ -7419,32 +7419,32 @@ test text-31.19 {peer widgets} -body { .t index sel.first } -cleanup { destroy .t -} -returnCodes {error} -result {text doesn't contain any characters tagged with "sel"} +} -returnCodes error -result {text doesn't contain any characters tagged with "sel"} test text-32.1 {line heights on creation} -setup { text .t proc makeText {} { - set w .g - set font "Times 11" - destroy .g - toplevel .g - frame $w.f -highlightthickness 2 -borderwidth 2 -relief sunken - set t $w.f.text - text $t -yscrollcommand "$w.scroll set" -setgrid true -font $font \ + set w .g + set font "Times 11" + destroy .g + toplevel .g + frame $w.f -highlightthickness 2 -borderwidth 2 -relief sunken + set t $w.f.text + text $t -yscrollcommand "$w.scroll set" -setgrid true -font $font \ -width 70 -height 35 -wrap word -highlightthickness 0 \ -borderwidth 0 - pack $t -expand yes -fill both - scrollbar $w.scroll -command "$t yview" - pack $w.scroll -side right -fill y - pack $w.f -expand yes -fill both - $t tag configure center -justify center -spacing1 5m -spacing3 5m - $t tag configure buttons -lmargin1 1c -lmargin2 1c -rmargin 1c \ - -spacing1 3m -spacing2 0 -spacing3 0 - for {set i 0} {$i < 40} {incr i} { - $t insert end "${i}word " - } - return $t + pack $t -expand yes -fill both + scrollbar $w.scroll -command "$t yview" + pack $w.scroll -side right -fill y + pack $w.f -expand yes -fill both + $t tag configure center -justify center -spacing1 5m -spacing3 5m + $t tag configure buttons -lmargin1 1c -lmargin2 1c -rmargin 1c \ + -spacing1 3m -spacing2 0 -spacing3 0 + for {set i 0} {$i < 40} {incr i} { + $t insert end "${i}word " + } + return $t } } -body { set w [makeText] @@ -7560,14 +7560,14 @@ test text-33.1 {TextWidgetCmd procedure, "peer" option} -setup { .t peer foo 1 } -cleanup { destroy .t -} -returnCodes {error} -result {bad peer option "foo": must be create or names} +} -returnCodes error -result {bad peer option "foo": must be create or names} test text-33.2 {TextWidgetCmd procedure, "peer" option} -setup { text .t } -body { .t peer names foo } -cleanup { destroy .t -} -returnCodes {error} -result {wrong # args: should be ".t peer names"} +} -returnCodes error -result {wrong # args: should be ".t peer names"} test text-33.3 {TextWidgetCmd procedure, "peer" option} -setup { text .t } -body { @@ -7588,7 +7588,7 @@ test text-33.5 {TextWidgetCmd procedure, "peer" option} -setup { .t peer create foo } -cleanup { destroy .t -} -returnCodes {error} -result {bad window path name "foo"} +} -returnCodes error -result {bad window path name "foo"} test text-33.6 {TextWidgetCmd procedure, "peer" option} -setup { text .t set res {} @@ -7616,7 +7616,7 @@ test text-33.8 {peer widget -start, -end} -body { .t configure -startline 10 -endline 5 } -cleanup { destroy .t -} -returnCodes {error} -result {-startline must be less than or equal to -endline} +} -returnCodes error -result {-startline must be less than or equal to -endline} test text-33.9 {peer widget -start, -end} -body { text .t for {set i 1} {$i < 100} {incr i} { @@ -7713,7 +7713,7 @@ 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} { - destroy .t + destroy .t } text .t } -body { @@ -7808,7 +7808,7 @@ test text-37.1 "bug #dd9667635d: text anchor not set" -setup { test text-38.1 {Extending selection with mouse going outside the widget - Bug a9cf210a42} -setup { pack [text .t -width 40 -height 10] for {set n 1} {$n <= 5} {incr n} { - .t insert end "This is line $i of text\n" + .t insert end "This is line $i of text\n" } update } -body { diff --git a/tests/textBTree.test b/tests/textBTree.test index 767e7a0..35d274f 100644 --- a/tests/textBTree.test +++ b/tests/textBTree.test @@ -53,7 +53,7 @@ proc setupBig {} { # Level 1: 2002 = 54*36 + 58 # Level 0: 2002 = 332*6 + 10 for {set i 0} {$i < 2000} {incr i} { - append x "Line $i abcd efgh ijkl\n" + append x "Line $i abcd efgh ijkl\n" } .t insert insert $x .t debug 1 @@ -261,7 +261,7 @@ test btree-2.22 {deleting into beginning of elided range} -setup { .t delete 1.0 end } -body { for {set n 1} {$n <= 10} {incr n} { - .t insert end "Line $n\n" + .t insert end "Line $n\n" } .t tag configure Elided -elide 1 .t tag add Elided 6.0 end @@ -273,7 +273,7 @@ test btree-2.22 {deleting into beginning of elided range} -setup { } -result "Line 4\nine 6\nLine 7\n" test btree-2.23 {deleting from within elided range} -body { for {set n 1} {$n <= 10} {incr n} { - .t insert end "Line $n\n" + .t insert end "Line $n\n" } .t tag configure Elided -elide 1 .t tag add Elided 6.0 8.0 @@ -285,7 +285,7 @@ test btree-2.23 {deleting from within elided range} -body { } -result "Line 6\nLine 9\n" test btree-2.24 {deleting whole elided range} -body { for {set n 1} {$n <= 10} {incr n} { - .t insert end "Line $n\n" + .t insert end "Line $n\n" } .t tag configure Elided -elide 1 .t tag add Elided 6.0 8.0 @@ -297,7 +297,7 @@ test btree-2.24 {deleting whole elided range} -body { } -result "Line 4\nLine 9\n" test btree-2.25 {deleting several elided ranges} -body { for {set n 1} {$n <= 10} {incr n} { - .t insert end "Line $n\n" + .t insert end "Line $n\n" } .t tag configure Elided -elide 1 .t tag add Elided 6.0 6.2 6.4 6.5 7.2 7.6 @@ -309,7 +309,7 @@ test btree-2.25 {deleting several elided ranges} -body { } -result "Line 4\nLine 9\nLine 10\n" test btree-2.26 {deleting first char of elided range} -body { for {set n 1} {$n <= 10} {incr n} { - .t insert end "Line $n\n" + .t insert end "Line $n\n" } .t tag configure Elided -elide 1 .t tag add Elided 6.0 end @@ -398,7 +398,7 @@ test btree-4.8 {deleting with tags} -body { test btree-5.1 {very large inserts, with tags} -setup { set bigText1 {} for {set i 0} {$i < 10} {incr i} { - append bigText1 "Line $i\n" + append bigText1 "Line $i\n" } } -body { setup @@ -408,7 +408,7 @@ test btree-5.1 {very large inserts, with tags} -setup { test btree-5.2 {very large inserts, with tags} -setup { set bigText2 {} for {set i 0} {$i < 200} {incr i} { - append bigText2 "Line $i\n" + append bigText2 "Line $i\n" } } -body { setup @@ -418,17 +418,17 @@ test btree-5.2 {very large inserts, with tags} -setup { test btree-5.3 {very large inserts, with tags} -body { setup for {set i 0} {$i < 200} {incr i} { - .t insert 1.8 "longer line $i\n" + .t insert 1.8 "longer line $i\n" } list [.t tag ranges x] [.t tag ranges y] [.t get 1.0 1.100] \ - [.t get 198.0 198.100] + [.t get 198.0 198.100] } -result {{1.1 1.2 1.5 201.5 202.2 202.6} {1.5 1.6} {Text forlonger line 199} {longer line 2}} test btree-6.1 {very large deletes, with tags} -setup { set bigText2 {} for {set i 0} {$i < 200} {incr i} { - append bigText2 "Line $i\n" + append bigText2 "Line $i\n" } } -body { setup @@ -439,20 +439,20 @@ test btree-6.1 {very large deletes, with tags} -setup { test btree-6.2 {very large deletes, with tags} -setup { set bigText2 {} for {set i 0} {$i < 200} {incr i} { - append bigText2 "Line $i\n" + append bigText2 "Line $i\n" } } -body { setup .t insert 1.1 $bigText2 for {set i 0} {$i < 200} {incr i} { - .t delete 1.2 2.2 + .t delete 1.2 2.2 } list [.t tag ranges x] [.t tag ranges y] } -result {{1.4 1.12 2.2 2.6} {1.4 1.5}} test btree-6.3 {very large deletes, with tags} -setup { set bigText2 {} for {set i 0} {$i < 200} {incr i} { - append bigText2 "Line $i\n" + append bigText2 "Line $i\n" } } -body { setup @@ -465,29 +465,29 @@ Lin test btree-6.4 {very large deletes, with tags} -setup { set bigText2 {} for {set i 0} {$i < 200} {incr i} { - append bigText2 "Line $i\n" + append bigText2 "Line $i\n" } } -body { setup .t insert 1.1 $bigText2 for {set i 0} {$i < 100} {incr i} { - .t delete 30.0 31.0 + .t delete 30.0 31.0 } list [.t tag ranges x] [.t tag ranges y] } -result {{101.0 101.1 101.4 101.12 102.2 102.6} {101.4 101.5}} test btree-6.5 {very large deletes, with tags} -setup { set bigText2 {} for {set i 0} {$i < 200} {incr i} { - append bigText2 "Line $i\n" + append bigText2 "Line $i\n" } } -body { setup .t insert 1.1 $bigText2 for {set i 0} {$i < 100} {incr i} { - set j [expr {$i+2}] - set k [expr {1+2*$i}] - .t tag add x $j.1 $j.3 - .t tag add y $k.1 $k.6 + set j [expr {$i+2}] + set k [expr {1+2*$i}] + .t tag add x $j.1 $j.3 + .t tag add y $k.1 $k.6 } .t delete 2.0 200.0 list [.t tag ranges x] [.t tag ranges y] @@ -495,19 +495,19 @@ test btree-6.5 {very large deletes, with tags} -setup { test btree-6.6 {very large deletes, with tags} -setup { set bigText2 {} for {set i 0} {$i < 200} {incr i} { - append bigText2 "Line $i\n" + append bigText2 "Line $i\n" } } -body { setup .t insert 1.1 $bigText2 for {set i 0} {$i < 100} {incr i} { - set j [expr {$i+2}] - set k [expr {1+2*$i}] - .t tag add x $j.1 $j.3 - .t tag add y $k.1 $k.6 + set j [expr {$i+2}] + set k [expr {1+2*$i}] + .t tag add x $j.1 $j.3 + .t tag add y $k.1 $k.6 } for {set i 199} {$i >= 2} {incr i -1} { - .t delete $i.0 [expr {$i+1}].0 + .t delete $i.0 [expr {$i+1}].0 } list [.t tag ranges x] [.t tag ranges y] } -result {{3.0 3.1 3.4 3.12 4.2 4.6} {1.1 1.6 3.4 3.5}} @@ -520,8 +520,8 @@ test btree-7.1 {tag addition and removal} -setup { .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info" set check {1.3 1.6 1.7 2.0} while {[llength $check]} { - .t tag add x [lindex $check 0] [lindex $check 1] - set check [lrange $check 2 end] + .t tag add x [lindex $check 0] [lindex $check 1] + set check [lrange $check 2 end] } .t tag ranges x } -result {1.3 1.6 1.7 2.0} @@ -532,8 +532,8 @@ test btree-7.2 {tag addition and removal} -setup { .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info" set check {1.3 1.6 1.6 2.0} while {[llength $check]} { - .t tag add x [lindex $check 0] [lindex $check 1] - set check [lrange $check 2 end] + .t tag add x [lindex $check 0] [lindex $check 1] + set check [lrange $check 2 end] } .t tag ranges x } -result {1.3 2.0} @@ -544,8 +544,8 @@ test btree-7.3 {tag addition and removal} -setup { .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info" set check {1.3 1.6 1.4 2.0} while {[llength $check]} { - .t tag add x [lindex $check 0] [lindex $check 1] - set check [lrange $check 2 end] + .t tag add x [lindex $check 0] [lindex $check 1] + set check [lrange $check 2 end] } .t tag ranges x } -result {1.3 2.0} @@ -556,8 +556,8 @@ test btree-7.4 {tag addition and removal} -setup { .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info" set check {2.0 4.3 1.4 1.10} while {[llength $check]} { - .t tag add x [lindex $check 0] [lindex $check 1] - set check [lrange $check 2 end] + .t tag add x [lindex $check 0] [lindex $check 1] + set check [lrange $check 2 end] } .t tag ranges x } -result {1.4 1.10 2.0 4.3} @@ -568,8 +568,8 @@ test btree-7.5 {tag addition and removal} -setup { .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info" set check {2.0 4.3 1.4 1.end} while {[llength $check]} { - .t tag add x [lindex $check 0] [lindex $check 1] - set check [lrange $check 2 end] + .t tag add x [lindex $check 0] [lindex $check 1] + set check [lrange $check 2 end] } .t tag ranges x } -result {1.4 1.19 2.0 4.3} @@ -580,8 +580,8 @@ test btree-7.6 {tag addition and removal} -setup { .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info" set check {2.0 4.3 1.4 2.0} while {[llength $check]} { - .t tag add x [lindex $check 0] [lindex $check 1] - set check [lrange $check 2 end] + .t tag add x [lindex $check 0] [lindex $check 1] + set check [lrange $check 2 end] } .t tag ranges x } -result {1.4 4.3} @@ -592,8 +592,8 @@ test btree-7.7 {tag addition and removal} -setup { .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info" set check {2.0 4.3 1.4 3.0} while {[llength $check]} { - .t tag add x [lindex $check 0] [lindex $check 1] - set check [lrange $check 2 end] + .t tag add x [lindex $check 0] [lindex $check 1] + set check [lrange $check 2 end] } .t tag ranges x } -result {1.4 4.3} @@ -604,8 +604,8 @@ test btree-7.8 {tag addition and removal} -setup { .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info" set check {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.1 4.2} while {[llength $check]} { - .t tag add x [lindex $check 0] [lindex $check 1] - set check [lrange $check 2 end] + .t tag add x [lindex $check 0] [lindex $check 1] + set check [lrange $check 2 end] } .t tag ranges x } -result {1.1 4.2} @@ -616,8 +616,8 @@ test btree-7.9 {tag addition and removal} -setup { .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info" set check {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.3 4.2} while {[llength $check]} { - .t tag add x [lindex $check 0] [lindex $check 1] - set check [lrange $check 2 end] + .t tag add x [lindex $check 0] [lindex $check 1] + set check [lrange $check 2 end] } .t tag ranges x } -result {1.2 4.2} @@ -628,8 +628,8 @@ test btree-7.10 {tag addition and removal} -setup { .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info" set check {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.1 3.0} while {[llength $check]} { - .t tag add x [lindex $check 0] [lindex $check 1] - set check [lrange $check 2 end] + .t tag add x [lindex $check 0] [lindex $check 1] + set check [lrange $check 2 end] } .t tag ranges x } -result {1.1 4.0} @@ -640,8 +640,8 @@ test btree-7.11 {tag addition and removal} -setup { .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info" set check {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.2 3.0} while {[llength $check]} { - .t tag add x [lindex $check 0] [lindex $check 1] - set check [lrange $check 2 end] + .t tag add x [lindex $check 0] [lindex $check 1] + set check [lrange $check 2 end] } .t tag ranges x } -result {1.2 4.0} @@ -719,7 +719,7 @@ test btree-9.2 {tag names} -body { test btree-9.3 {lots of tag names} -setup { set bigText2 {} for {set i 0} {$i < 200} {incr i} { - append bigText2 "Line $i\n" + append bigText2 "Line $i\n" } } -body { setup @@ -735,7 +735,7 @@ test btree-9.3 {lots of tag names} -setup { test btree-9.4 {lots of tag names} -setup { set bigText2 {} for {set i 0} {$i < 200} {incr i} { - append bigText2 "Line $i\n" + append bigText2 "Line $i\n" } } -body { setup @@ -893,7 +893,7 @@ test btree-13.7 {tag searching} -setup { test btree-13.8 {tag searching} -setup { set bigText2 {} for {set i 0} {$i < 200} {incr i} { - append bigText2 "Line $i\n" + append bigText2 "Line $i\n" } } -body { setup @@ -909,7 +909,7 @@ test btree-14.1 {check tag presence} -setup { text .t set bigText2 {} for {set i 0} {$i < 200} {incr i} { - append bigText2 "Line $i\n" + append bigText2 "Line $i\n" } } -body { setup @@ -1026,13 +1026,13 @@ test btree-16.6 {two node splits at once pushes root up} -setup { text .t } -body { for {set i 1} {$i < 10} {incr i} { - .t insert end "Line $i\n" + .t insert end "Line $i\n" } .t tag add x 8.0 8.end .t tag add y 9.0 end set x {} for {} {$i < 50} {incr i} { - append x "Line $i\n" + append x "Line $i\n" } .t insert end $x y list [.t tag ranges x] [.t tag ranges y] @@ -1044,7 +1044,7 @@ test btree-16.7 {Partial tag remove from before first range} -setup { destroy .t text .t for {set i 1} {$i < 10} {incr i} { - .t insert end "Line $i\n" + .t insert end "Line $i\n" } } -body { .t tag add x 2.0 2.6 @@ -1057,7 +1057,7 @@ test btree-16.8 {Partial tag remove from before first range} -setup { destroy .t text .t for {set i 1} {$i < 10} {incr i} { - .t insert end "Line $i\n" + .t insert end "Line $i\n" } } -body { .t tag add x 2.0 2.6 @@ -1070,7 +1070,7 @@ test btree-16.9 {Partial tag remove from before first range} -setup { destroy .t text .t for {set i 1} {$i < 10} {incr i} { - .t insert end "Line $i\n" + .t insert end "Line $i\n" } } -body { .t tag add x 2.0 2.6 @@ -1083,7 +1083,7 @@ test btree-16.10 {Partial tag remove from before first range} -setup { destroy .t text .t for {set i 1} {$i < 10} {incr i} { - .t insert end "Line $i\n" + .t insert end "Line $i\n" } } -body { .t tag add x 1.0 2.6 @@ -1096,7 +1096,7 @@ test btree-16.11 {StartSearchBack boundary case} -setup { destroy .t text .t for {set i 1} {$i < 10} {incr i} { - .t insert end "Line $i\n" + .t insert end "Line $i\n" } } -body { .t tag add x 1.3 1.4 @@ -1108,7 +1108,7 @@ test btree-16.12 {StartSearchBack boundary case} -setup { destroy .t text .t for {set i 1} {$i < 10} {incr i} { - .t insert end "Line $i\n" + .t insert end "Line $i\n" } } -body { .t tag add x 1.3 1.4 @@ -1120,7 +1120,7 @@ test btree-16.13 {StartSearchBack boundary case} -setup { destroy .t text .t for {set i 1} {$i < 10} {incr i} { - .t insert end "Line $i\n" + .t insert end "Line $i\n" } } -body { .t tag add x 1.0 1.4 diff --git a/tests/textDisp.test b/tests/textDisp.test index 7583bc4..3555ae7 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -38,10 +38,10 @@ proc scrollError args { proc lequal {res expected} { if {[llength $res] != [llength $expected]} { - return [list "Lengths differ" result: $res - expected: $expected] + return [list "Lengths differ" result: $res - expected: $expected] } for {set i 0} {$i < [llength $res]} {incr i} { - if {[lindex $res $i] ne [lindex $expected $i]} { + if {[lindex $res $i] ne [lindex $expected $i]} { return [list result: $res - expected: $expected] } } @@ -286,7 +286,7 @@ test textDisp-1.2 {GetStyle procedure, wrapmode} { .t tag add y 1.end 2.2 lappend result [.t bbox 2.20] } [list [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \ - [list [xchar 5] [yline 3] $fixedWidth $fixedHeight] \ + [list [xchar 5] [yline 3] $fixedWidth $fixedHeight] \ {}] .t tag delete x y @@ -296,35 +296,35 @@ test textDisp-2.1 {LayoutDLine, basics} { .t insert 1.0 "This is some sample text for testing." list [.t bbox 1.19] [.t bbox 1.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-2.2 {LayoutDLine, basics} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "This isx some sample text for testing." list [.t bbox 1.19] [.t bbox 1.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-2.3 {LayoutDLine, basics} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "This isxxx some sample text for testing." list [.t bbox 1.19] [.t bbox 1.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-2.4 {LayoutDLine, word wrap} { .t configure -wrap word .t delete 1.0 end .t insert 1.0 "This is some sample text for testing." list [.t bbox 1.19] [.t bbox 1.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-2.5 {LayoutDLine, word wrap} { .t configure -wrap word .t delete 1.0 end .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 [xchar 13] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ + [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 20] [yline 1] 0 $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-2.6 {LayoutDLine, word wrap} { @@ -333,7 +333,7 @@ test textDisp-2.6 {LayoutDLine, word wrap} { .t insert 1.0 "This isxxx some sample text for testing." list [.t bbox 1.15] [.t bbox 1.16] } [list [list [xchar 15] [yline 1] [xe 15] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-2.7 {LayoutDLine, marks and tags} { .t configure -wrap word .t delete 1.0 end @@ -342,7 +342,7 @@ test textDisp-2.7 {LayoutDLine, marks and tags} { .t mark set insert 1.8 list [.t bbox 1.2] [.t bbox 1.5] [.t bbox 1.11] } [list [list [xchar 2] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 5] [yline 1] $fixedWidth $fixedHeight] \ + [list [xchar 5] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 11] [yline 1] $fixedWidth $fixedHeight]] foreach m [.t mark names] { catch {.t mark unset $m} @@ -361,14 +361,14 @@ test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} -setup { wm geom . {} update } -result [list [list [xchar 19] [yline 1] [expr {$fixedWidth+1}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-2.9 {LayoutDLine, marks and tags} { .t configure -wrap word .t delete 1.0 end .t insert 1.0 "This is a very_very_long_word_that_wraps." list [.t bbox 1.9] [.t bbox 1.10] [.t bbox 1.25] } [list [list [xchar 9] [yline 1] [xe 9] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ [list [xchar 15] [yline 2] $fixedWidth $fixedHeight]] test textDisp-2.10 {LayoutDLine, marks and tags} { .t configure -wrap word @@ -380,7 +380,7 @@ test textDisp-2.10 {LayoutDLine, marks and tags} { .t tag add foo 1.19 list [.t bbox 1.9] [.t bbox 1.10] [.t bbox 1.25] } [list [list [xchar 9] [yline 1] [xe 9] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ [list [xchar 15] [yline 2] $fixedWidth $fixedHeight]] test textDisp-2.11 {LayoutDLine, newline width} { .t configure -wrap char @@ -388,7 +388,7 @@ test textDisp-2.11 {LayoutDLine, newline width} { .t insert 1.0 "a\nbb\nccc\ndddd" list [.t bbox 2.2] [.t bbox 3.3] } [list [list [xchar 2] [yline 2] [xe 2] $fixedHeight] \ - [list [xchar 3] [yline 3] [xe 3] $fixedHeight]] + [list [xchar 3] [yline 3] [xe 3] $fixedHeight]] test textDisp-2.12 {LayoutDLine, justification} { .t configure -wrap char .t delete 1.0 end @@ -398,9 +398,9 @@ test textDisp-2.12 {LayoutDLine, justification} { .t tag add y 3.0 3.2 list [.t bbox 1.0] [.t bbox 2.0] [.t bbox 4.0] [.t bbox 4.2] } [list [list [expr {[bo]+[xe 0]/2}] [yline 1] [expr {[xe 0]-[xe 0]/2}] $fixedHeight] \ - [list [expr {[bo]+[xe 1]/2}] [yline 2] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+[xe 3]/2}] [yline 4] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+[xe 3]/2+[xw 2]}] [yline 4] $fixedWidth $fixedHeight]] + [list [expr {[bo]+[xe 1]/2}] [yline 2] $fixedWidth $fixedHeight] \ + [list [expr {[bo]+[xe 3]/2}] [yline 4] $fixedWidth $fixedHeight] \ + [list [expr {[bo]+[xe 3]/2+[xw 2]}] [yline 4] $fixedWidth $fixedHeight]] test textDisp-2.13 {LayoutDLine, justification} { .t configure -wrap char .t delete 1.0 end @@ -410,9 +410,9 @@ test textDisp-2.13 {LayoutDLine, justification} { .t tag add y 3.0 3.2 list [.t bbox 1.0] [.t bbox 2.0] [.t bbox 4.0] [.t bbox 4.2] } [list [list [xcharr 0] [yline 1] 0 $fixedHeight] \ - [list [xcharr 1] [yline 2] $fixedWidth $fixedHeight] \ - [list [xcharr 3] [yline 4] $fixedWidth $fixedHeight] \ - [list [xcharr 1] [yline 4] $fixedWidth $fixedHeight]] + [list [xcharr 1] [yline 2] $fixedWidth $fixedHeight] \ + [list [xcharr 3] [yline 4] $fixedWidth $fixedHeight] \ + [list [xcharr 1] [yline 4] $fixedWidth $fixedHeight]] test textDisp-2.14 {LayoutDLine, justification} { .t configure -wrap char .t delete 1.0 end @@ -424,9 +424,9 @@ test textDisp-2.14 {LayoutDLine, justification} { .t tag raise y list [.t bbox 2.0] [.t bbox 3.0] [.t bbox 3.end] [.t bbox 4.0] } [list [list [expr {[bo]+[xe 1]/2}] [yline 2] $fixedWidth $fixedHeight] \ - [list [xcharr 2] [yline 3] $fixedWidth $fixedHeight] \ - [list [xcharr 0] [yline 3] 0 $fixedHeight] \ - [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]] + [list [xcharr 2] [yline 3] $fixedWidth $fixedHeight] \ + [list [xcharr 0] [yline 3] 0 $fixedHeight] \ + [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]] test textDisp-2.15 {LayoutDLine, justification} { .t configure -wrap char .t delete 1.0 end @@ -438,9 +438,9 @@ test textDisp-2.15 {LayoutDLine, justification} { .t tag lower y list [.t bbox 2.0] [.t bbox 3.0] [.t bbox 3.end] [.t bbox 4.0] } [list [list [expr {[bo]+[xe 1]/2}] [yline 2] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+[xe 2]/2}] [yline 3] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+[xe 2]/2+[xw 2]}] [yline 3] [expr {[xe 2]/2}] $fixedHeight] \ - [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]] + [list [expr {[bo]+[xe 2]/2}] [yline 3] $fixedWidth $fixedHeight] \ + [list [expr {[bo]+[xe 2]/2+[xw 2]}] [yline 3] [expr {[xe 2]/2}] $fixedHeight] \ + [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]] test textDisp-2.16 {LayoutDLine, justification} { .t configure -wrap word .t delete 1.0 end @@ -450,9 +450,9 @@ test textDisp-2.16 {LayoutDLine, justification} { .t tag add x 1.21 1.end list [.t bbox 1.0] [.t bbox 1.20] [.t bbox 1.41] [.t bbox 2.0] } [list [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+[xe 4]/2}] [yline 3] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ + [list [expr {[bo]+[xe 4]/2}] [yline 3] $fixedWidth $fixedHeight] \ + [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]] test textDisp-2.17 {LayoutDLine, justification} { .t configure -wrap word .t delete 1.0 end @@ -461,9 +461,9 @@ test textDisp-2.17 {LayoutDLine, justification} { .t tag add x 1.18 list [.t bbox 1.0] [.t bbox 1.18] [.t bbox 1.35] [.t bbox 2.0] } [list [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+[xe 17]/2}] [yline 2] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]] + [list [expr {[bo]+[xe 17]/2}] [yline 2] $fixedWidth $fixedHeight] \ + [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \ + [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]] test textDisp-2.18 {LayoutDLine, justification} { .t configure -wrap none .t delete 1.0 end @@ -476,7 +476,7 @@ test textDisp-2.18 {LayoutDLine, justification} { .t xview scroll 5 units list [.t bbox 2.0] [.t bbox 3.0] } [list [list [expr {[bo]+[xe 4]/2-[xw 5]}] [yline 2] $fixedWidth $fixedHeight] \ - [list [expr {[xcharr 10]-[xw 5]}] [yline 3] $fixedWidth $fixedHeight]] + [list [expr {[xcharr 10]-[xw 5]}] [yline 3] $fixedWidth $fixedHeight]] .t tag delete x .t tag delete y test textDisp-2.19 {LayoutDLine, margins} { @@ -490,9 +490,9 @@ test textDisp-2.19 {LayoutDLine, margins} { .t tag configure x -lmargin1 $lm1 -lmargin2 $lm2 -rmargin $rm .t tag add x 1.0 end set expected [list [list [expr {[bo]+$lm1}] [yline 1] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+$lm1+[xw 12]}] [yline 1] [expr {[xe 12]-$lm1}] $fixedHeight] \ - [list [expr {[bo]+$lm2}] [yline 2] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+$lm1}] [yline 6] $fixedWidth $fixedHeight]] + [list [expr {[bo]+$lm1+[xw 12]}] [yline 1] [expr {[xe 12]-$lm1}] $fixedHeight] \ + [list [expr {[bo]+$lm2}] [yline 2] $fixedWidth $fixedHeight] \ + [list [expr {[bo]+$lm1}] [yline 6] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.0] [.t bbox 1.12] [.t bbox 1.13] [.t bbox 2.0]] $expected } {1} test textDisp-2.20 {LayoutDLine, margins} { @@ -506,9 +506,9 @@ test textDisp-2.20 {LayoutDLine, margins} { .t tag add y 1.13 list [.t bbox 1.0] [.t bbox 1.13] [.t bbox 1.30] [.t bbox 2.0] } [list [list [expr {[bo]+20}] [yline 1] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+5}] [yline 2] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+10}] [yline 3] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+20}] [yline 4] $fixedWidth $fixedHeight]] + [list [expr {[bo]+5}] [yline 2] $fixedWidth $fixedHeight] \ + [list [expr {[bo]+10}] [yline 3] $fixedWidth $fixedHeight] \ + [list [expr {[bo]+20}] [yline 4] $fixedWidth $fixedHeight]] test textDisp-2.21 {LayoutDLine, margins} { .t configure -wrap word .t delete 1.0 end @@ -517,8 +517,8 @@ test textDisp-2.21 {LayoutDLine, margins} { .t tag add x 1.0 end list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 1.2] } [list [list [expr {[bo]+80}] [yline 1] [expr {[xe 0]-80}] $fixedHeight] \ - [list [expr {[bo]+80}] [yline 2] [expr {[xe 0]-80}] $fixedHeight] \ - [list [expr {[bo]+80}] [yline 3] [expr {[xe 0]-80}] $fixedHeight]] + [list [expr {[bo]+80}] [yline 2] [expr {[xe 0]-80}] $fixedHeight] \ + [list [expr {[bo]+80}] [yline 3] [expr {[xe 0]-80}] $fixedHeight]] .t tag delete x .t tag delete y test textDisp-2.22 {LayoutDLine, spacing options} { @@ -602,7 +602,7 @@ test textDisp-2.25 {LayoutDLine, tabs, breaking chunks at tabs} { .t tag add x 1.0 end set expected [list [expr {[bo]+$tw}] [expr {[bo]+2*$tw}] [expr {[bo]+3*$tw}] [expr {[bo]+4*$tw}]] set res [list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.4] 0] \ - [lindex [.t bbox 1.6] 0] [lindex [.t bbox 1.8] 0]] + [lindex [.t bbox 1.6] 0] [lindex [.t bbox 1.8] 0]] lequal $res $expected } {1} # Next test is currently constrained to not run on mac (aqua) because on @@ -653,7 +653,7 @@ test textDisp-3.1 {different character sizes} haveBigFontTwiceLargerThanTextFont .t tag add big 2.11 2.14 list [.t bbox 1.1] [.t bbox 1.6] [.t dlineinfo 1.0] [.t dlineinfo 3.0] } [list [list [xchar 1] [expr {[yline 1]+$ascentDiff}] $fixedWidth $fixedHeight] \ - [list [expr {[xchar 5]+[font measure $bigFont s]}] [yline 1] [font measure $bigFont a] $bigHeight] \ + [list [expr {[xchar 5]+[font measure $bigFont s]}] [yline 1] [font measure $bigFont a] $bigHeight] \ [list [bo] [yline 1] [expr {[xw 5]+[font measure $bigFont sampl]+[xw 2]}] $bigHeight $bigAscent] \ [list [bo] [expr {[bo]+2*$bigHeight+2*$fixedHeight}] [xw 5] $fixedHeight $fixedAscent]] .t configure -wrap char @@ -669,7 +669,7 @@ test textDisp-4.1 {UpdateDisplayInfo, basic} { update lappend res [.t bbox 1.0] [.t bbox 2.0] [.t bbox 3.0] $tk_textRelayout } [list 2.0 \ - [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \ + [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \ 2.0] @@ -685,7 +685,7 @@ test textDisp-4.2 {UpdateDisplayInfo, re-use tail of text line} { update lappend res [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout } [list 2.0 2.20 \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ [list [xchar 1] [yline 3] $fixedWidth $fixedHeight] \ [list [xchar 0] [yline 4] $fixedWidth $fixedHeight] \ {2.0 2.20}] @@ -698,7 +698,7 @@ test textDisp-4.3 {UpdateDisplayInfo, tail of text line shifts} { update list [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout } [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \ + [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \ [list [xchar 0] [yline 4] $fixedWidth $fixedHeight] \ {2.0 2.20}] .t mark unset x @@ -709,7 +709,7 @@ test textDisp-4.4 {UpdateDisplayInfo, wrap-mode "none"} { update list [.t bbox 2.0] [.t bbox 2.25] [.t bbox 3.0] $tk_textRelayout } [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ - {} \ + {} \ [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \ {1.0 2.0 3.0}] test textDisp-4.5 {UpdateDisplayInfo, tiny window} { @@ -724,7 +724,7 @@ test textDisp-4.5 {UpdateDisplayInfo, tiny window} { update list [.t bbox 2.0] [.t bbox 2.1] [.t bbox 3.0] $tk_textRelayout } [list [list [xchar 0] [yline 2] 1 $fixedHeight] \ - {} \ + {} \ [list [xchar 0] [yline 3] 1 $fixedHeight] \ {1.0 2.0 3.0}] if {[tk windowingsystem] eq "win32"} { @@ -880,8 +880,8 @@ test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} { list $tk_textRelayout $tk_textRedraw [.t bbox 2.0] [.t bbox 2.5] \ [.t bbox 2.23] } [list {} {1.0 2.0 3.0 4.0} \ - {} \ - [list [expr {[xchar 5]-[xw 3]}] [yline 2] $fixedWidth $fixedHeight] \ + {} \ + [list [expr {[xchar 5]-[xw 3]}] [yline 2] $fixedWidth $fixedHeight] \ {}] test textDisp-4.18 {UpdateDisplayInfo, horizontal scrolling} { .t configure -wrap none @@ -893,7 +893,7 @@ test textDisp-4.18 {UpdateDisplayInfo, horizontal scrolling} { update list $tk_textRelayout $tk_textRedraw [.t bbox 2.25] } [list {} {1.0 2.0 3.0 4.0} \ - [list [xcharr 19] [yline 2] $fixedWidth $fixedHeight]] + [list [xcharr 19] [yline 2] $fixedWidth $fixedHeight]] test textDisp-4.19 {UpdateDisplayInfo, horizontal scrolling} { .t configure -wrap none .t delete 1.0 end @@ -918,7 +918,7 @@ test textDisp-4.20 {UpdateDisplayInfo, horizontal scrolling} { update list $tk_textRelayout $tk_textRedraw [.t bbox 2.25] } [list 2.0 {1.0 2.0 3.0 4.0} \ - [list [xcharr 5] [yline 2] $fixedWidth $fixedHeight]] + [list [xcharr 5] [yline 2] $fixedWidth $fixedHeight]] test textDisp-4.21 {UpdateDisplayInfo, horizontal scrolling} { .t configure -wrap none .t delete 1.0 end @@ -940,7 +940,7 @@ test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap .t configure -wrap word list [.t bbox 2.0] [.t bbox 2.16] } [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ - [list [xchar 1] [yline 3] $fixedWidth $fixedHeight]] + [list [xchar 1] [yline 3] $fixedWidth $fixedHeight]] test textDisp-4.23 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} { .t configure -wrap none .t delete 1.0 end @@ -971,7 +971,7 @@ test textDisp-5.1 {DisplayDLine, handling of spacing} { list [winfo geometry .t.f1] [winfo geometry .t.f2] \ [winfo geometry .t.f3] [winfo geometry .t.f4] } [list 10x4+[xchar 3]+[expr {[yline 1]+8}] \ - 10x4+[expr {[xchar 6]+10}]+[expr {[yline 1]+8+($fixedHeight-4)/2}] \ + 10x4+[expr {[xchar 6]+10}]+[expr {[yline 1]+8+($fixedHeight-4)/2}] \ 10x4+[xchar 1]+[expr {[yline 2]+8+2+8+($fixedHeight-4)}] \ 10x4+[expr {[xchar 9]+10}]+[expr {[yline 2]+8+2+8+($fixedAscent-4)}]] .t tag delete spacing @@ -1107,22 +1107,28 @@ test textDisp-6.9 {DisplayText, horizontal scrollbar updates} { set scrollInfo } [list 0.0 [expr {4.0/11}]] test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll} {aqua} { + # For this test to pass line 8 must be out of the text widget. + # With macOS 14 this requires making the buttons a little larger. + # So we set the pady option. This may depend on the OS version. .t configure -wrap char + update .t delete 1.0 end + update .t insert 1.0 "Line 1" foreach i {2 3 4} { .t insert end "\nLine $i" } .t insert end "\n" .t window create end -create { - button %W.button_one -text "Button 1"} + button %W.button_one -text "Button 1" -pady 5} .t insert end "\nLine 6\n" .t window create end -create { - button %W.button_two -text "Button 2"} + button %W.button_two -text "Button 2" -pady 5} .t insert end "\nLine 8\n" .t window create end -create { - button %W.button_three -text "Button 3"} + button %W.button_three -text "Button 3" -pady 5} update + set tk_textEmbWinDisplay {} .t delete 2.0 3.0 update list $tk_textEmbWinDisplay @@ -1346,7 +1352,7 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an .t delete 1.0 end .t configure -wrap none for {set i 1} {$i < 25} {incr i} { - .t insert end "Line $i Line $i\n" + .t insert end "Line $i Line $i\n" } .t tag add hidden 5.0 8.0 .t tag configure hidden -elide true @@ -1529,7 +1535,7 @@ test textDisp-9.13 {TkTextRedrawTag} { .t configure -wrap none .t delete 1.0 end for {set i 1} {$i < 10} {incr i} { - .t insert end "Line $i - This is Line [format %c [expr {64+$i}]]\n" + .t insert end "Line $i - This is Line [format %c [expr {64+$i}]]\n" } .t tag add hidden 2.8 2.17 .t tag add hidden 6.8 7.17 @@ -1543,24 +1549,24 @@ test textDisp-9.13 {TkTextRedrawTag} { test textDisp-9.14 {TkTextRedrawTag} { pack [text .tnocrash] for {set i 1} {$i < 6} {incr i} { - .tnocrash insert end \nfoo$i + .tnocrash insert end \nfoo$i } .tnocrash tag configure mytag1 -relief raised .tnocrash tag configure mytag2 -relief solid update proc doit {} { - .tnocrash tag add mytag1 4.0 5.0 - .tnocrash tag add mytag2 4.0 5.0 - after idle { - .tnocrash tag remove mytag1 1.0 end - .tnocrash tag remove mytag2 1.0 end - } - .tnocrash delete 1.0 2.0 + .tnocrash tag add mytag1 4.0 5.0 + .tnocrash tag add mytag2 4.0 5.0 + after idle { + .tnocrash tag remove mytag1 1.0 end + .tnocrash tag remove mytag2 1.0 end + } + .tnocrash delete 1.0 2.0 } doit ; # must not crash after 500 { - destroy .tnocrash - set done 1 + destroy .tnocrash + set done 1 } vwait done } {} @@ -1750,8 +1756,8 @@ test textDisp-11.17 {TkTextSetYView, only a few lines visible} { test textDisp-11.18 {TkTextSetYView, see in elided lines} { .top.t delete 1.0 end for {set i 1} {$i < 20} {incr i} { - .top.t insert end [string repeat "Line $i" 10] - .top.t insert end "\n" + .top.t insert end [string repeat "Line $i" 10] + .top.t insert end "\n" } .top.t yview 4.0 .top.t tag add hidden 4.10 "4.10 lineend" @@ -1765,7 +1771,7 @@ test textDisp-11.18 {TkTextSetYView, see in elided lines} { test textDisp-11.19 {TkTextSetYView, see in elided lines} { .top.t delete 1.0 end for {set i 1} {$i < 50} {incr i} { - .top.t insert end "Line $i\n" + .top.t insert end "Line $i\n" } # button just for having a line with a larger height button .top.t.b -text "Test" -bd 2 -highlightthickness 2 @@ -1797,8 +1803,8 @@ test textDisp-11.20 {TkTextSetYView, see in elided lines} { .top.t delete 1.0 end .top.t configure -wrap none for {set i 1} {$i < 5} {incr i} { - .top.t insert end [string repeat "Line $i " 50] - .top.t insert end "\n" + .top.t insert end [string repeat "Line $i " 50] + .top.t insert end "\n" } .top.t delete 3.11 3.14 .top.t tag add hidden 3.0 4.0 @@ -1808,7 +1814,7 @@ test textDisp-11.20 {TkTextSetYView, see in elided lines} { test textDisp-11.21 {TkTextSetYView, window height smaller than the line height} { .top.t delete 1.0 end for {set i 1} {$i <= 10} {incr i} { - .top.t insert end "Line $i\n" + .top.t insert end "Line $i\n" } set lineheight [font metrics [.top.t cget -font] -linespace] wm geometry .top 200x[expr {$lineheight / 2}] @@ -1819,7 +1825,7 @@ test textDisp-11.21 {TkTextSetYView, window height smaller than the line height} test textDisp-11.22 {TkTextSetYView, peer has -startline} { .top.t delete 1.0 end for {set i 1} {$i <= 50} {incr i} { - .top.t insert end "Line $i\n" + .top.t insert end "Line $i\n" } pack [.top.t peer create .top.p] -side left pack [scrollbar .top.sb -command {.top.p yview}] -side left -fill y @@ -1951,9 +1957,9 @@ test textDisp-13.8 {TkTextSeeCmd procedure} { # therefore take into account that the top line is partially hidden set y [expr {[yline 6] + [lindex [.t bbox @0,0] 1] - [bo]}] set expected [list [list [xchar 10] $y $fixedWidth $fixedHeight] \ - [list [xchar 19] $y $fixedWidth $fixedHeight] \ - [list [xchar 19] $y $fixedWidth $fixedHeight] \ - [list [xchar 10] $y $fixedWidth $fixedHeight]] + [list [xchar 19] $y $fixedWidth $fixedHeight] \ + [list [xchar 19] $y $fixedWidth $fixedHeight] \ + [list [xchar 10] $y $fixedWidth $fixedHeight]] lequal $x $expected } {1} test textDisp-13.9 {TkTextSeeCmd procedure} { @@ -1975,9 +1981,9 @@ test textDisp-13.9 {TkTextSeeCmd procedure} { # therefore take into account that the top line is partially hidden set y [expr {[yline 6] + [lindex [.t bbox @0,0] 1] - [bo]}] set expected [list [list [expr {[bo]+round([winfo width .t]-2*[bo])/2}] $y $fixedWidth $fixedHeight] \ - [list [xcharr 1] $y $fixedWidth $fixedHeight] \ - [list [xcharr 1] $y $fixedWidth $fixedHeight] \ - [list [expr {[bo]+round([winfo width .t]-2*[bo])/2}] $y $fixedWidth $fixedHeight]] + [list [xcharr 1] $y $fixedWidth $fixedHeight] \ + [list [xcharr 1] $y $fixedWidth $fixedHeight] \ + [list [expr {[bo]+round([winfo width .t]-2*[bo])/2}] $y $fixedWidth $fixedHeight]] lequal $x $expected } {1} test textDisp-13.10 {TkTextSeeCmd procedure} { @@ -1998,7 +2004,7 @@ test textDisp-13.11 {TkTextSeeCmd procedure} {} { toplevel .top2 pack [text .top2.t2 -wrap none] for {set i 1} {$i < 5} {incr i} { - .top2.t2 insert end [string repeat "Line $i: éèàçù" 5]\n + .top2.t2 insert end [string repeat "Line $i: éèàçù" 5]\n } wm geometry .top2 300x200+0+0 update @@ -2216,7 +2222,7 @@ update set totpix [.t count -update -ypixels 1.0 end] # check that the wrapping lines wrap exactly 6 times in total (4 times for line 151, and twice for line 153), # this is an assumption of the upcoming tests -if {[expr {double(($totpix-5*$heightDiff)/$fixedHeight)}] != 206.0} { +if {double(($totpix-5*$heightDiff)/$fixedHeight) != 206.0} { puts "---> Warning: the font actually used by the tests, which is \"[font actual [.t cget -font]]\",\ is too different from the requested \"[.t cget -font]\". Some of the upcoming tests will probably fail." } @@ -2279,7 +2285,7 @@ test textDisp-16.14 {TkTextYviewCmd procedure, "moveto" option} { set ytargetline [expr {150*$fixedHeight+5*$heightDiff}] set expected 151.0 while {[expr {$ytargetline+$fixedHeight}] <= [expr {round(0.75*$totpix)}]} { - incr ytargetline $fixedHeight + incr ytargetline $fixedHeight set expected [.t index "$expected + 1 display line"] } lequal [.t index @0,0] $expected @@ -2294,7 +2300,7 @@ test textDisp-16.15 {TkTextYviewCmd procedure, "moveto" option} { set ytargetline [expr {150*$fixedHeight+5*$heightDiff}] set expected 151.0 while {[expr {$ytargetline+$fixedHeight}] <= [expr {round(0.75*$totpix + ($pixtonextline-1))}]} { - incr ytargetline $fixedHeight + incr ytargetline $fixedHeight set expected [.t index "$expected + 1 display line"] } lequal [.t index @0,0] $expected @@ -2309,7 +2315,7 @@ test textDisp-16.16 {TkTextYviewCmd procedure, "moveto" option} { set ytargetline [expr {150*$fixedHeight+5*$heightDiff}] set expected 151.0 while {[expr {$ytargetline+$fixedHeight}] <= [expr {round(0.75*$totpix + $pixtonextline)}]} { - incr ytargetline $fixedHeight + incr ytargetline $fixedHeight set expected [.t index "$expected + 1 display line"] } lequal [.t index @0,0] $expected @@ -2501,8 +2507,8 @@ test textDisp-16.41 {text count -xpixels with indices in elided lines} { set res {} .t delete 1.0 end for {set i 1} {$i < 40} {incr i} { - .t insert end [string repeat "Line $i" 20] - .t insert end "\n" + .t insert end [string repeat "Line $i" 20] + .t insert end "\n" } .t configure -wrap none .t tag add hidden 5.15 20.15 @@ -2524,8 +2530,8 @@ test textDisp-16.42 {TkTextYviewCmd procedure with indices in elided lines} { .t configure -wrap none .t delete 1.0 end for {set i 1} {$i < 100} {incr i} { - .t insert end [string repeat "Line $i" 20] - .t insert end "\n" + .t insert end [string repeat "Line $i" 20] + .t insert end "\n" } .t tag add hidden 5.15 20.15 .t tag configure hidden -elide true @@ -2538,8 +2544,8 @@ test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} { .t configure -wrap none .t delete 1.0 end for {set i 1} {$i < 100} {incr i} { - .t insert end [string repeat "Line $i" 20] - .t insert end "\n" + .t insert end [string repeat "Line $i" 20] + .t insert end "\n" } .t tag add hidden 5.15 20.15 .t tag configure hidden -elide true @@ -3135,7 +3141,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 {20 * $fixedHeight}] \ - [expr {20 * $fixedHeight}] \ + [expr {20 * $fixedHeight}] \ $fixedHeight \ [expr {2*$fixedHeight}] \ $fixedHeight \ @@ -3144,8 +3150,8 @@ test textDisp-19.17 {count -ypixels with indices in elided lines} { .t configure -wrap none .t delete 1.0 end for {set i 1} {$i < 100} {incr i} { - .t insert end [string repeat "Line $i" 20] - .t insert end "\n" + .t insert end [string repeat "Line $i" 20] + .t insert end "\n" } .t tag add hidden 5.15 20.15 .t tag configure hidden -elide true @@ -3168,7 +3174,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}] \ + [expr {3 * $fixedHeight}] \ 0 0 0 0 0 0 \ [expr {5 * $fixedHeight}] \ [expr {- 5 * $fixedHeight}] \ @@ -3179,8 +3185,8 @@ test textDisp-19.18 {count -ypixels with indices in elided lines} { .t configure -wrap none .t delete 1.0 end for {set i 1} {$i < 100} {incr i} { - .t insert end [string repeat "Line $i" 20] - .t insert end "\n" + .t insert end [string repeat "Line $i" 20] + .t insert end "\n" } .t tag add hidden 5.15 20.15 .t tag configure hidden -elide true @@ -3197,8 +3203,8 @@ test textDisp-19.19 {count -ypixels with indices in elided lines} { .t configure -wrap char .t delete 1.0 end for {set i 1} {$i < 25} {incr i} { - .t insert end [string repeat "Line $i -" 6] - .t insert end "\n" + .t insert end [string repeat "Line $i -" 6] + .t insert end "\n" } .t tag add hidden 5.27 11.0 .t tag configure hidden -elide true @@ -3225,8 +3231,8 @@ test textDisp-20.2 {FindDLine} { set centlineY [lindex [.t bbox 53.0] 1] set expectedY [expr {$centlineY - int(($centlineY-[bo])/$fixedHeight)*$fixedHeight - $fixedHeight}] set expected [list [list [bo] $expectedY [xw 20] $fixedHeight $fixedAscent] \ - [list [bo] $expectedY [xw 20] $fixedHeight $fixedAscent] \ - [list [bo] [expr {$expectedY+$fixedHeight}] [xw 19] $fixedHeight $fixedAscent]] + [list [bo] $expectedY [xw 20] $fixedHeight $fixedAscent] \ + [list [bo] [expr {$expectedY+$fixedHeight}] [xw 19] $fixedHeight $fixedAscent]] set res [list [.t dlineinfo 50.0] [.t dlineinfo 50.14] [.t dlineinfo 50.21]] lequal $res $expected } {1} @@ -3235,14 +3241,14 @@ test textDisp-20.3 {FindDLine} { .t yview 49.0 list [.t dlineinfo 50.0] [.t dlineinfo 50.24] [.t dlineinfo 57.0] } [list [list [bo] [yline 2] [xw 20] $fixedHeight $fixedAscent] \ - [list [bo] [yline 3] [xw 19] $fixedHeight $fixedAscent] \ + [list [bo] [yline 3] [xw 19] $fixedHeight $fixedAscent] \ {}] test textDisp-20.4 {FindDLine} { .t yview 100.0 .t yview 42.0 list [.t dlineinfo 50.0] [.t dlineinfo 50.24] [.t dlineinfo 50.40] } [list [list [bo] [yline 9] [xw 20] $fixedHeight $fixedAscent] \ - [list [bo] [yline 10] [xw 19] $fixedHeight $fixedAscent] \ + [list [bo] [yline 10] [xw 19] $fixedHeight $fixedAscent] \ {}] .t config -wrap none test textDisp-20.5 {FindDLine} { @@ -3250,7 +3256,7 @@ test textDisp-20.5 {FindDLine} { .t yview 48.0 list [.t dlineinfo 50.0] [.t dlineinfo 50.20] [.t dlineinfo 50.40] } [list [list [bo] [yline 3] [xw 53] $fixedHeight $fixedAscent] \ - [list [bo] [yline 3] [xw 53] $fixedHeight $fixedAscent] \ + [list [bo] [yline 3] [xw 53] $fixedHeight $fixedAscent] \ [list [bo] [yline 3] [xw 53] $fixedHeight $fixedAscent]] .t config -wrap word @@ -3265,7 +3271,7 @@ test textDisp-21.2 {TkTextPixelIndex} { .t yview 195.0 set off [expr {[xchar 1]+1}] list [.t index @$off,[expr {[yline 6]+2}]] \ - [.t index @$off,[expr {[yline 7]+2}]] \ + [.t index @$off,[expr {[yline 7]+2}]] \ [.t index @$off,[expr {[yline 8]+2}]] \ [.t index @$off,1002] } {197.1 198.1 199.1 201.0} @@ -3320,8 +3326,8 @@ test textDisp-22.1 {TkTextCharBbox} { list [.t bbox 47.2] [.t bbox 48.0] [.t bbox 50.5] [.t bbox 50.40] \ [.t bbox 58.0] } [list {} \ - [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 5] [yline 3] $fixedWidth $fixedHeight] \ + [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \ + [list [xchar 5] [yline 3] $fixedWidth $fixedHeight] \ [list [xchar 0] [yline 5] $fixedWidth $fixedHeight] \ {}] test textDisp-22.2 {TkTextCharBbox} { @@ -3329,7 +3335,7 @@ test textDisp-22.2 {TkTextCharBbox} { .t yview 48.0 list [.t bbox 50.5] [.t bbox 50.40] [.t bbox 57.0] } [list [list [xchar 5] [yline 3] $fixedWidth $fixedHeight] \ - {} \ + {} \ [list [xchar 0] [yline 10] $fixedWidth $fixedHeight]] test textDisp-22.3 {TkTextCharBbox, cut-off lines} { wm geometry . {} @@ -3340,7 +3346,7 @@ test textDisp-22.3 {TkTextCharBbox, cut-off lines} { wm geom . ${width}x[expr {$height-1}] update set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \ - [list [xchar 1] [yline 11] $fixedWidth [expr {($height-1)-$oriHeight}]]] + [list [xchar 1] [yline 11] $fixedWidth [expr {($height-1)-$oriHeight}]]] lequal [list [.t bbox 19.1] [.t bbox 20.1]] $expected } {1} test textDisp-22.4 {TkTextCharBbox, cut-off lines} { @@ -3352,7 +3358,7 @@ test textDisp-22.4 {TkTextCharBbox, cut-off lines} { wm geom . ${width}x[expr {$height+1}] update set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \ - [list [xchar 1] [yline 11] $fixedWidth [expr {($height+1)-$oriHeight}]]] + [list [xchar 1] [yline 11] $fixedWidth [expr {($height+1)-$oriHeight}]]] lequal [list [.t bbox 19.1] [.t bbox 20.1]] $expected } {1} test textDisp-22.5 {TkTextCharBbox, cut-off char} { @@ -3374,8 +3380,8 @@ test textDisp-22.6 {TkTextCharBbox, line visible but not char} haveBigFontTwiceL wm geom . ${width}x[expr {$height+3}] update set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \ - {} \ - [list [xchar 2] [yline 11] [font measure $bigFont "n"] [expr {($height+3)-$oriHeight}]]] + {} \ + [list [xchar 2] [yline 11] [font measure $bigFont "n"] [expr {($height+3)-$oriHeight}]]] lequal [list [.t bbox 19.1] [.t bbox 20.1] [.t bbox 20.2]] $expected } {1} wm geom . {} @@ -3387,7 +3393,7 @@ test textDisp-22.7 {TkTextCharBbox, different character sizes} haveBigFontTwiceL update list [.t bbox 12.1] [.t bbox 12.2] } [list [list [xchar 1] [expr {[yline 3]+$ascentDiff}] $fixedWidth $fixedHeight] \ - [list [xchar 2] [yline 3] [font measure $bigFont "n"] $bigHeight]] + [list [xchar 2] [yline 3] [font measure $bigFont "n"] $bigHeight]] .t tag remove big 1.0 end test textDisp-22.8 {TkTextCharBbox, horizontal scrolling} { .t configure -wrap none @@ -3398,7 +3404,7 @@ test textDisp-22.8 {TkTextCharBbox, horizontal scrolling} { list [.t bbox 1.3] [.t bbox 1.4] [.t bbox 2.3] [.t bbox 2.4] \ [.t bbox 2.23] [.t bbox 2.24] } [list {} \ - [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \ + [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \ {} \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ [list [xchar 19] [yline 2] $fixedWidth $fixedHeight] \ @@ -3421,7 +3427,7 @@ test textDisp-22.9 {TkTextCharBbox, handling of spacing} { list [.t bbox .t.f1] [.t bbox .t.f2] [.t bbox .t.f3] [.t bbox .t.f4] \ [.t bbox 1.1] [.t bbox 2.9] } [list [list [xchar 3] [expr {[yline 1]+8}] 10 4] \ - [list [expr {[xchar 3]+10+[xw 3]}] [expr {[yline 1]+8+($fixedHeight-4)/2}] 10 4] \ + [list [expr {[xchar 3]+10+[xw 3]}] [expr {[yline 1]+8+($fixedHeight-4)/2}] 10 4] \ [list [xchar 1] [expr {[yline 2]+8+2+8+($fixedHeight-4)}] 10 4] \ [list [expr {[xchar 1]+10+[xw 8]}] [expr {[yline 2]+8+2+8+($fixedAscent-4)}] 10 4] \ [list [xchar 1] [expr {[yline 1]+8}] $fixedWidth $fixedHeight] \ @@ -3431,37 +3437,37 @@ test textDisp-22.10 {TkTextCharBbox, handling of elided lines} { .t configure -wrap char .t delete 1.0 end for {set i 1} {$i < 10} {incr i} { - .t insert end "Line $i - Line [format %c [expr {64+$i}]]\n" + .t insert end "Line $i - Line [format %c [expr {64+$i}]]\n" } .t tag add hidden 2.8 2.13 .t tag add hidden 6.8 7.13 .t tag configure hidden -elide true update list \ - [expr {[lindex [.t bbox 2.9] 0] - [lindex [.t bbox 2.8] 0]}] \ - [expr {[lindex [.t bbox 2.10] 0] - [lindex [.t bbox 2.8] 0]}] \ - [expr {[lindex [.t bbox 2.13] 0] - [lindex [.t bbox 2.8] 0]}] \ - [expr {[lindex [.t bbox 6.9] 0] - [lindex [.t bbox 6.8] 0]}] \ - [expr {[lindex [.t bbox 6.10] 0] - [lindex [.t bbox 6.8] 0]}] \ - [expr {[lindex [.t bbox 6.13] 0] - [lindex [.t bbox 6.8] 0]}] \ - [expr {[lindex [.t bbox 6.14] 0] - [lindex [.t bbox 6.8] 0]}] \ - [expr {[lindex [.t bbox 6.15] 0] - [lindex [.t bbox 6.8] 0]}] \ - [expr {[lindex [.t bbox 7.0] 0] - [lindex [.t bbox 6.8] 0]}] \ - [expr {[lindex [.t bbox 7.1] 0] - [lindex [.t bbox 6.8] 0]}] \ - [expr {[lindex [.t bbox 7.12] 0] - [lindex [.t bbox 6.8] 0]}] + [expr {[lindex [.t bbox 2.9] 0] - [lindex [.t bbox 2.8] 0]}] \ + [expr {[lindex [.t bbox 2.10] 0] - [lindex [.t bbox 2.8] 0]}] \ + [expr {[lindex [.t bbox 2.13] 0] - [lindex [.t bbox 2.8] 0]}] \ + [expr {[lindex [.t bbox 6.9] 0] - [lindex [.t bbox 6.8] 0]}] \ + [expr {[lindex [.t bbox 6.10] 0] - [lindex [.t bbox 6.8] 0]}] \ + [expr {[lindex [.t bbox 6.13] 0] - [lindex [.t bbox 6.8] 0]}] \ + [expr {[lindex [.t bbox 6.14] 0] - [lindex [.t bbox 6.8] 0]}] \ + [expr {[lindex [.t bbox 6.15] 0] - [lindex [.t bbox 6.8] 0]}] \ + [expr {[lindex [.t bbox 7.0] 0] - [lindex [.t bbox 6.8] 0]}] \ + [expr {[lindex [.t bbox 7.1] 0] - [lindex [.t bbox 6.8] 0]}] \ + [expr {[lindex [.t bbox 7.12] 0] - [lindex [.t bbox 6.8] 0]}] } [list 0 0 0 0 0 0 0 0 0 0 0] test textDisp-22.11 {TkTextCharBbox, handling of wrapped elided lines} { .t configure -wrap char .t delete 1.0 end for {set i 1} {$i < 10} {incr i} { - .t insert end "Line $i - Line _$i - Lines .$i - Line [format %c [expr {64+$i}]]\n" + .t insert end "Line $i - Line _$i - Lines .$i - Line [format %c [expr {64+$i}]]\n" } .t tag add hidden 1.30 2.5 .t tag configure hidden -elide true update list \ - [expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.4] 0]}] \ - [expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.5] 0]}] + [expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.4] 0]}] \ + [expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.5] 0]}] } [list 0 0] .t delete 1.0 end @@ -3479,7 +3485,7 @@ test textDisp-23.1 {TkTextDLineInfo} { list [.t dlineinfo 47.3] [.t dlineinfo 48.0] [.t dlineinfo 50.40] \ [.t dlineinfo 56.0] } [list {} \ - [list [bo] [yline 1] [xw 7] $fixedHeight $fixedAscent] \ + [list [bo] [yline 1] [xw 7] $fixedHeight $fixedAscent] \ [list [bo] [yline 5] [xw 13] $fixedHeight $fixedAscent] \ {}] .t config -bd 4 @@ -3496,7 +3502,7 @@ test textDisp-23.3 {TkTextDLineInfo} { .t yview 48.0 list [.t dlineinfo 50.40] [.t dlineinfo 57.3] } [list [list [bo] [yline 3] [xw 53] $fixedHeight $fixedAscent] \ - [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent]] + [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent]] test textDisp-23.4 {TkTextDLineInfo, cut-off lines} { wm geometry . {} update @@ -3506,7 +3512,7 @@ test textDisp-23.4 {TkTextDLineInfo, cut-off lines} { wm geom . ${width}x[expr {$height-1}] update set expected [list [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent] \ - [list [bo] [yline 11] [xw 7] [expr {($height-1)-$oriHeight}] $fixedAscent]] + [list [bo] [yline 11] [xw 7] [expr {($height-1)-$oriHeight}] $fixedAscent]] lequal [list [.t dlineinfo 19.0] [.t dlineinfo 20.0]] $expected } {1} test textDisp-23.5 {TkTextDLineInfo, cut-off lines} { @@ -3518,7 +3524,7 @@ test textDisp-23.5 {TkTextDLineInfo, cut-off lines} { wm geom . ${width}x[expr {$height+1}] update set expected [list [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent] \ - [list [bo] [yline 11] [xw 7] [expr {($height+1)-$oriHeight}] $fixedAscent]] + [list [bo] [yline 11] [xw 7] [expr {($height+1)-$oriHeight}] $fixedAscent]] lequal [list [.t dlineinfo 19.0] [.t dlineinfo 20.0]] $expected } {1} wm geom . {} @@ -3533,7 +3539,7 @@ test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} { update list [.t dlineinfo 1.0] [.t dlineinfo 2.0] [.t dlineinfo 3.0] } [list [list [expr {[xw -6]+[bo]}] [yline 1] [xw 10] $fixedHeight $fixedAscent] \ - [list [expr {[xw -6]+[bo]}] [yline 2] [xw 52] $fixedHeight $fixedAscent] \ + [list [expr {[xw -6]+[bo]}] [yline 2] [xw 52] $fixedHeight $fixedAscent] \ [list [expr {[xw -6]+[bo]}] [yline 3] [xw 5] $fixedHeight $fixedAscent]] .t xview moveto 0 test textDisp-23.7 {TkTextDLineInfo, centering} { @@ -3548,7 +3554,7 @@ test textDisp-23.7 {TkTextDLineInfo, centering} { .t tag add y 3.0 list [.t dlineinfo 1.0] [.t dlineinfo 2.0] [.t dlineinfo 3.0] } [list [list [expr {[bo]+[xe 10]/2}] [yline 1] [xw 10] $fixedHeight $fixedAscent] \ - [list [bo] [yline 2] [xw 17] $fixedHeight $fixedAscent] \ + [list [bo] [yline 2] [xw 17] $fixedHeight $fixedAscent] \ [list [xcharr 5] [yline 5] [xw 5] $fixedHeight $fixedAscent]] .t tag delete x y @@ -3558,7 +3564,7 @@ test textDisp-24.1 {TkTextCharLayoutProc} { .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" list [.t bbox 1.19] [.t bbox 1.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-24.2 {TkTextCharLayoutProc} { wm geometry . {} update @@ -3569,12 +3575,12 @@ test textDisp-24.2 {TkTextCharLayoutProc} { # be tolerant about borderwidth et al. - don't let another char fit on the line set wi $width while {$wi+1-$oriWidth >= $fixedWidth} { - incr wi -$fixedWidth + incr wi -$fixedWidth } wm geom . [expr {$wi+1}]x$height update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($wi+1-$oriWidth)}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.3 {TkTextCharLayoutProc} { @@ -3587,7 +3593,7 @@ test textDisp-24.3 {TkTextCharLayoutProc} { wm geom . [expr {$width-1}]x$height update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-1-$oriWidth)}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} { @@ -3598,7 +3604,7 @@ test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} { update list [.t bbox 1.19] [.t bbox 1.20] [.t bbox 2.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 20] [yline 1] 0 $fixedHeight] \ + [list [xchar 20] [yline 1] 0 $fixedHeight] \ [list [xchar 0] [yline 3] $fixedWidth $fixedHeight]] test textDisp-24.5 {TkTextCharLayoutProc, char doesn't fit, newline not visible} {nonwin} { .t configure -wrap char @@ -3611,7 +3617,7 @@ test textDisp-24.5 {TkTextCharLayoutProc, char doesn't fit, newline not visible} update list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 2.0] } [list [list [xchar 0] [yline 1] [expr {$fixedWidth-[bo]}] $fixedHeight] \ - [list [expr {[xchar 1]-[bo]}] [yline 1] 0 $fixedHeight] \ + [list [expr {[xchar 1]-[bo]}] [yline 1] 0 $fixedHeight] \ [list [xchar 0] [yline 2] [expr {$fixedWidth-[bo]}] $fixedHeight]] test textDisp-24.6 {TkTextCharLayoutProc, line ends with space} { .t configure -wrap char @@ -3621,7 +3627,7 @@ test textDisp-24.6 {TkTextCharLayoutProc, line ends with space} { update list [.t bbox 1.19] [.t bbox 1.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} { wm geometry . {} update @@ -3632,12 +3638,12 @@ test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} { # be tolerant about borderwidth et al. - don't let another char fit on the line set wi $width while {$wi+1-$oriWidth >= $fixedWidth} { - incr wi -$fixedWidth + incr wi -$fixedWidth } wm geom . [expr {$wi+1}]x$height update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($wi+1-$oriWidth)}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.8 {TkTextCharLayoutProc, line ends with space} { @@ -3650,7 +3656,7 @@ test textDisp-24.8 {TkTextCharLayoutProc, line ends with space} { wm geom . [expr {$width-1}]x$height update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-1-$oriWidth)}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.9 {TkTextCharLayoutProc, line ends with space} { @@ -3663,7 +3669,7 @@ test textDisp-24.9 {TkTextCharLayoutProc, line ends with space} { wm geom . [expr {$width-6}]x$height update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-6-$oriWidth)}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.10 {TkTextCharLayoutProc, line ends with space} { @@ -3676,7 +3682,7 @@ test textDisp-24.10 {TkTextCharLayoutProc, line ends with space} { wm geom . [expr {$width-7}]x$height update set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-7-$oriWidth)}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't quite fit} { @@ -3691,7 +3697,7 @@ test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't qui .t mark set insert 1.21 lappend result [.t bbox 1.21] [.t bbox 2.0] } [list [list [expr {[xchar 20]+2}] [yline 1] 0 $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ [list [expr {[xchar 20]+2}] [yline 1] 0 $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] wm geom . {} @@ -3703,7 +3709,7 @@ test textDisp-24.12 {TkTextCharLayoutProc, tab causes wrap} { .t mark set insert 1.4 .t insert insert \t\t\t set expected [list [list [expr {[xchar 0]+2*8*$fixedWidth}] [yline 1] [expr {[winfo width .t]-([xchar 0]+2*8*$fixedWidth)-[bo]}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox {insert -1c}] [.t bbox insert]] $expected } {1} test textDisp-24.13 {TkTextCharLayoutProc, -wrap none} { @@ -3724,7 +3730,7 @@ test textDisp-24.14 {TkTextCharLayoutProc, -wrap none} { wm geom . [expr {$width+1}]x$height update set expected [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 20] [yline 1] [expr {$width+1-$oriWidth}] $fixedHeight]] + [list [xchar 20] [yline 1] [expr {$width+1-$oriWidth}] $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.15 {TkTextCharLayoutProc, -wrap none} { @@ -3737,7 +3743,7 @@ test textDisp-24.15 {TkTextCharLayoutProc, -wrap none} { wm geom . [expr {$width-1}]x$height update set expected [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 20] [yline 1] [expr {$width-1-$oriWidth}] $fixedHeight]] + [list [xchar 20] [yline 1] [expr {$width-1-$oriWidth}] $fixedHeight]] lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected } {1} test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} { @@ -3753,7 +3759,7 @@ test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} { update list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 1.2] } [list [list [xchar 0] [yline 1] 1 $fixedHeight] \ - [list [xchar 0] [yline 2] 1 $fixedHeight] \ + [list [xchar 0] [yline 2] 1 $fixedHeight] \ [list [xchar 0] [yline 3] 1 $fixedHeight]] if {[tk windowingsystem] eq "win32"} { wm overrideredirect . 0 @@ -3766,7 +3772,7 @@ test textDisp-24.17 {TkTextCharLayoutProc, -wrap word} { update list [.t bbox 1.19] [.t bbox 1.20] } [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-24.18 {TkTextCharLayoutProc, -wrap word} { .t configure -wrap word .t delete 1.0 end @@ -3775,7 +3781,7 @@ test textDisp-24.18 {TkTextCharLayoutProc, -wrap word} { update list [.t bbox 1.15] [.t bbox 1.16] [.t bbox 1.17] [.t bbox 1.21] } [list [list [xchar 15] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 16] [yline 1] [xe 16] $fixedHeight] \ + [list [xchar 16] [yline 1] [xe 16] $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ [list [xchar 4] [yline 2] $fixedWidth $fixedHeight]] test textDisp-24.19 {TkTextCharLayoutProc, -wrap word} { @@ -3786,7 +3792,7 @@ test textDisp-24.19 {TkTextCharLayoutProc, -wrap word} { update list [.t bbox 1.14] [.t bbox 1.15] [.t bbox 1.16] } [list [list [xchar 14] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar 15] [yline 1] $fixedWidth $fixedHeight] \ + [list [xchar 15] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 16] [yline 1] [xe 16] $fixedHeight]] test textDisp-24.20 {TkTextCharLayoutProc, vertical offset} { .t configure -wrap none @@ -3802,11 +3808,11 @@ test textDisp-24.20 {TkTextCharLayoutProc, vertical offset} { .t tag delete up set result } [list [list [xchar 1] [yline 2] $fixedWidth $fixedHeight] \ - [list [bo] [yline 2] [xw 6] $fixedHeight $fixedAscent] \ + [list [bo] [yline 2] [xw 6] $fixedHeight $fixedAscent] \ [list [xchar 1] [yline 2] $fixedWidth $fixedHeight] \ - [list [bo] [yline 2] [xw 6] [expr {$fixedHeight+6}] [expr {$fixedAscent+6}]] \ + [list [bo] [yline 2] [xw 6] [expr {$fixedHeight+6}] [expr {$fixedAscent+6}]] \ [list [xchar 1] [expr {[yline 2]+2}] $fixedWidth $fixedHeight] \ - [list [bo] [yline 2] [xw 6] [expr {$fixedHeight+2}] $fixedAscent]] + [list [bo] [yline 2] [xw 6] [expr {$fixedHeight+2}] $fixedAscent]] .t configure -width 30 update test textDisp-24.21 {TkTextCharLayoutProc, word breaks} { @@ -3849,7 +3855,7 @@ test textDisp-24.24 {TkTextCharLayoutProc, justification and tabs} notAqua { .t tag add x 1.0 end list [.t bbox 1.0] [.t bbox 1.10] } [list [list [expr {[bo]+[xe 8]/2}] [yline 1] $fixedWidth $fixedHeight] \ - [list [expr {[bo]+[xe 8]/2+[xw 7]}] [yline 1] $fixedWidth $fixedHeight]] + [list [expr {[bo]+[xe 8]/2+[xw 7]}] [yline 1] $fixedWidth $fixedHeight]] test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -setup { text .tt -tabs {40 right} -wrap none -font $fixedFont pack .tt @@ -3857,8 +3863,8 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -setup { .tt insert end \t9\n\t99\n\t999 update set expected [list [list [expr {[bo .tt]+40-$fixedWidth}] [yline 1 .tt] $fixedWidth $fixedHeight] \ - [list [expr {[bo .tt]+40-$fixedWidth}] [yline 2 .tt] $fixedWidth $fixedHeight] \ - [list [expr {[bo .tt]+40-$fixedWidth}] [yline 3 .tt] $fixedWidth $fixedHeight]] + [list [expr {[bo .tt]+40-$fixedWidth}] [yline 2 .tt] $fixedWidth $fixedHeight] \ + [list [expr {[bo .tt]+40-$fixedWidth}] [yline 3 .tt] $fixedWidth $fixedHeight]] lequal [list [.tt bbox 1.1] [.tt bbox 2.2] [.tt bbox 3.3]] $expected } -cleanup { destroy .tt @@ -3872,7 +3878,7 @@ test textDisp-25.1 {CharBboxProc procedure, check tab width} { .t insert 1.0 abc\td\tfgh list [.t bbox 1.3] [.t bbox 1.5] [.t bbox 1.6] } [list [list [xchar 3] [yline 1] [expr {100-3*$fixedWidth}] $fixedHeight] \ - [list [expr {[bo]+100+$fixedWidth}] [yline 1] [expr {200-(100+$fixedWidth)}] $fixedHeight] \ + [list [expr {[bo]+100+$fixedWidth}] [yline 1] [expr {200-(100+$fixedWidth)}] $fixedHeight] \ [list [expr {[bo]+200}] [yline 1] $fixedWidth $fixedHeight]] .t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 -pady 0 \ @@ -3884,7 +3890,7 @@ test textDisp-26.1 {AdjustForTab procedure, no tabs} { list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.12] 0] \ [lindex [.t bbox 1.14] 0] } [list [expr {[bo]+8*$fixedWidth}] \ - [expr {[bo]+2*8*$fixedWidth+2*$fixedWidth}] \ + [expr {[bo]+2*8*$fixedWidth+2*$fixedWidth}] \ [expr {[bo]+3*8*$fixedWidth}]] test textDisp-26.1.2 {AdjustForTab procedure, no tabs} { .t delete 1.0 end @@ -3895,7 +3901,7 @@ test textDisp-26.1.2 {AdjustForTab procedure, no tabs} { .t configure -tabstyle tabular set res } [list [expr {[bo]+8*$fixedWidth}] \ - [expr {[bo]+3*8*$fixedWidth}] \ + [expr {[bo]+3*8*$fixedWidth}] \ [expr {[bo]+4*8*$fixedWidth}]] test textDisp-26.2 {AdjustForTab procedure, not enough tabs specified} { .t delete 1.0 end @@ -4019,7 +4025,7 @@ test textDisp-26.13 {AdjustForTab procedure, not enough space} { .t tag add x 1.0 end set expected [list [xchar 4] [xchar 8] [xchar 12] $t4] set res [list [lindex [.t bbox 1.4] 0] [lindex [.t bbox 1.8] 0] \ - [lindex [.t bbox 1.12] 0] [lindex [.t bbox 1.16] 0]] + [lindex [.t bbox 1.12] 0] [lindex [.t bbox 1.16] 0]] lequal $res $expected } {1} test textDisp-26.13.2 {AdjustForTab procedure, not enough space} { @@ -4068,7 +4074,7 @@ test textDisp-27.1 {SizeOfTab procedure, old-style tabs} { .t insert 1.0 a\tbcdefghij\tc\td list [.t bbox 1.2] [.t bbox 1.10] [.t bbox 1.12] } [list [list [xchar 8] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar [expr {8+8}]] [yline 1] $fixedWidth $fixedHeight] \ + [list [xchar [expr {8+8}]] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar [expr {8+8+1+1}]] [yline 1] $fixedWidth $fixedHeight]] test textDisp-27.1.1 {SizeOfTab procedure, old-style tabs} { .t delete 1.0 end @@ -4078,7 +4084,7 @@ test textDisp-27.1.1 {SizeOfTab procedure, old-style tabs} { .t configure -tabstyle tabular set res } [list [list [xchar 8] [yline 1] $fixedWidth $fixedHeight] \ - [list [xchar [expr {8+8}]] [yline 1] $fixedWidth $fixedHeight] \ + [list [xchar [expr {8+8}]] [yline 1] $fixedWidth $fixedHeight] \ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-27.2 {SizeOfTab procedure, choosing tabX and alignment} { .t delete 1.0 end @@ -4090,7 +4096,7 @@ test textDisp-27.2 {SizeOfTab procedure, choosing tabX and alignment} { .t tag configure x -tabs $tw .t tag add x 1.0 end set expected [list [list [expr {[bo]+$tw+[xw 1]}] [yline 1] [expr {[winfo width .t]-([bo]+$tw+[xw 1])-[bo]}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.3] [.t bbox 1.4]] $expected } {1} test textDisp-27.3 {SizeOfTab procedure, choosing tabX and alignment} { @@ -4103,7 +4109,7 @@ test textDisp-27.3 {SizeOfTab procedure, choosing tabX and alignment} { .t tag configure x -tabs $tw .t tag add x 1.0 end set expected [list [list [expr {[bo]+3*$tw+[xw 1]}] [yline 1] [expr {[winfo width .t]-([bo]+3*$tw+[xw 1])-[bo]}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.5] [.t bbox 1.6]] $expected } {1} test textDisp-27.4 {SizeOfTab procedure, choosing tabX and alignment} { @@ -4116,7 +4122,7 @@ test textDisp-27.4 {SizeOfTab procedure, choosing tabX and alignment} { .t tag configure x -tabs "20 center $tw left" .t tag add x 1.0 end set expected [list [list [expr {[bo]+$tw+($tw-20)+[xw 1]}] [yline 1] [expr {[winfo width .t]-([bo]+$tw+($tw-20)+[xw 1])-[bo]}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.5] [.t bbox 1.6]] $expected } {1} test textDisp-27.5 {SizeOfTab procedure, center alignment} { @@ -4129,7 +4135,7 @@ test textDisp-27.5 {SizeOfTab procedure, center alignment} { .t tag configure x -tabs "$tw center" .t tag add x 1.0 end set expected [list [list [expr {[bo]+$tw+round(1.5*$fixedWidth)}] [yline 1] [expr {[winfo width .t]-([bo]+$tw+round(1.5*$fixedWidth))-[bo]}] $fixedHeight] \ - [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] lequal [list [.t bbox 1.6] [.t bbox 1.7]] $expected } {1} test textDisp-27.6 {SizeOfTab procedure, center alignment} { @@ -4140,7 +4146,7 @@ test textDisp-27.6 {SizeOfTab procedure, center alignment} { .t tag add x 1.0 end list [.t bbox 1.6] [.t bbox 1.7] } [list [list [xchar 4] [yline 2] $fixedWidth $fixedHeight] \ - [list [xchar 5] [yline 2] $fixedWidth $fixedHeight]] + [list [xchar 5] [yline 2] $fixedWidth $fixedHeight]] test textDisp-27.7 {SizeOfTab procedure, center alignment, wrap -none (potential numerical problems)} { .t delete 1.0 end set cm [winfo fpixels .t 1c] @@ -4210,7 +4216,7 @@ test textDisp-27.8 {SizeOfTab procedure, right alignment} { .t tag add x 1.0 end list [.t bbox 1.6] [.t bbox 1.7] } [list [list [xcharr 1] [yline 1] $fixedWidth $fixedHeight] \ - [list [bo] [yline 2] $fixedWidth $fixedHeight]] + [list [bo] [yline 2] $fixedWidth $fixedHeight]] test textDisp-27.9 {SizeOfTab procedure, left alignment} { .t delete 1.0 end .t insert 1.0 a\txyzzyabc @@ -4219,7 +4225,7 @@ test textDisp-27.9 {SizeOfTab procedure, left alignment} { .t tag add x 1.0 end list [.t bbox 1.3] [.t bbox 1.4] } [list [list [expr {round([bo]+17.14*$fixedWidth+$fixedWidth)}] [yline 1] [expr {[winfo width .t]-round([bo]+17.14*$fixedWidth+$fixedWidth)-[bo]}] $fixedHeight] \ - [list [bo] [yline 2] $fixedWidth $fixedHeight]] + [list [bo] [yline 2] $fixedWidth $fixedHeight]] test textDisp-27.10 {SizeOfTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\t123.4 @@ -4228,7 +4234,7 @@ test textDisp-27.10 {SizeOfTab procedure, numeric alignment} { .t tag add x 1.0 end list [.t bbox 1.3] [.t bbox 1.4] } [list [list [expr {round([bo]+17.14*$fixedWidth-$fixedWidth)}] [yline 1] [expr {[winfo width .t]-round([bo]+17.14*$fixedWidth-$fixedWidth)-[bo]}] $fixedHeight] \ - [list [bo] [yline 2] $fixedWidth $fixedHeight]] + [list [bo] [yline 2] $fixedWidth $fixedHeight]] test textDisp-27.11 {SizeOfTab procedure, making tabs at least as wide as a space} { .t delete 1.0 end .t insert 1.0 abc\tdefghijklmnopqrst @@ -4237,7 +4243,7 @@ test textDisp-27.11 {SizeOfTab procedure, making tabs at least as wide as a spac .t tag add x 1.0 end list [.t bbox 1.5] [.t bbox 1.6] } [list [list [expr {round([bo]+17.14*$fixedWidth+$fixedWidth)}] [yline 1] [expr {[winfo width .t]-round([bo]+17.14*$fixedWidth+$fixedWidth)-[bo]}] $fixedHeight] \ - [list [bo] [yline 2] $fixedWidth $fixedHeight]] + [list [bo] [yline 2] $fixedWidth $fixedHeight]] proc bizarre_scroll args { .t2.t delete 5.0 end @@ -4275,8 +4281,8 @@ test textDisp-29.1 {miscellaneous: lines wrap but are still too long} -setup { .t2.t window create 1.1 -window .t2.t.f update set expected [list [list 0.0 [expr {20.0*$fixedWidth/300}]] \ - 300x50+[bo .t2.t]+[yline 2 .t2.t] \ - [list [xchar 1 .t2.t] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]] + 300x50+[bo .t2.t]+[yline 2 .t2.t] \ + [list [xchar 1 .t2.t] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]] lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected } -cleanup { destroy .t2 @@ -4298,8 +4304,8 @@ test textDisp-29.2 {miscellaneous: lines wrap but are still too long} -setup { .t2.t xview scroll 1 unit update set expected [list [list [expr {1.0*$fixedWidth/300}] [expr {21.0*$fixedWidth/300}]] \ - 300x50+[expr {[bo .t2.t]-$fixedWidth}]+[yline 2 .t2.t] \ - [list [expr {[bo .t2.t]-$fixedWidth+$fixedWidth}] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]] + 300x50+[expr {[bo .t2.t]-$fixedWidth}]+[yline 2 .t2.t] \ + [list [expr {[bo .t2.t]-$fixedWidth+$fixedWidth}] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]] lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected } -cleanup { destroy .t2 @@ -4340,8 +4346,8 @@ test textDisp-29.2.2 {miscellaneous: lines wrap but are still too long} -setup { .t2.t xview scroll 2 unit update set expected [list [list [expr {2.0*$fixedWidth/300}] [expr {22.0*$fixedWidth/300}]] \ - 300x50+[expr {[bo .t2.t]-2*$fixedWidth}]+[yline 2 .t2.t] \ - {}] + 300x50+[expr {[bo .t2.t]-2*$fixedWidth}]+[yline 2 .t2.t] \ + {}] lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected } -cleanup { destroy .t2 @@ -4363,8 +4369,8 @@ test textDisp-29.2.3 {miscellaneous: lines wrap but are still too long} -setup { .t2.t xview scroll 7 pixels update set expected [list [list [expr {7.0/300}] [expr {(20.0*$fixedWidth+7)/300}]] \ - 300x50+[expr {[bo .t2.t]-7}]+[yline 2 .t2.t] \ - [list [expr {[bo .t2.t]+$fixedWidth-7}] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]] + 300x50+[expr {[bo .t2.t]-7}]+[yline 2 .t2.t] \ + [list [expr {[bo .t2.t]+$fixedWidth-7}] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]] lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected } -cleanup { destroy .t2 @@ -4386,8 +4392,8 @@ test textDisp-29.2.4 {miscellaneous: lines wrap but are still too long} -setup { .t2.t xview scroll 17 pixels update set expected [list [list [expr {17.0/300}] [expr {(20.0*$fixedWidth+17)/300}]] \ - 300x50+[expr {[bo .t2.t]-17}]+[yline 2 .t2.t] \ - {}] + 300x50+[expr {[bo .t2.t]-17}]+[yline 2 .t2.t] \ + {}] lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected } -cleanup { destroy .t2 @@ -4439,8 +4445,8 @@ test textDisp-29.3 {miscellaneous: lines wrap but are still too long} -setup { .t2.t xview scroll 200 units update set expected [list [list [expr {double(300-20*$fixedWidth)/300}] 1.0] \ - 300x50+[expr {-(300-20*$fixedWidth-[bo .t2.t])}]+[yline 2 .t2.t] \ - {}] + 300x50+[expr {-(300-20*$fixedWidth-[bo .t2.t])}]+[yline 2 .t2.t] \ + {}] lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected } -cleanup { destroy .t2 @@ -4492,7 +4498,7 @@ test textDisp-31.1 {line embedded window height update} { lappend res [.t count -ypixels 1.0 end] lappend res [.t count -update -ypixels 1.0 end] } [list [expr {100+$fixedHeight*6}] \ - [expr {100+$fixedHeight*6}] \ + [expr {100+$fixedHeight*6}] \ [expr {$fixedHeight*7}]] test textDisp-31.2 {line update index shifting} { set res {} @@ -4509,7 +4515,7 @@ test textDisp-31.2 {line update index shifting} { lappend res [.t count -ypixels 1.0 end] lappend res [.t count -update -ypixels 1.0 end] } [list [expr {100+$fixedHeight*6}] \ - [expr {100+$fixedHeight*8}] \ + [expr {100+$fixedHeight*8}] \ [expr {$fixedHeight*9}] \ [expr {$fixedHeight*7}] \ [expr {100+$fixedHeight*6}]] @@ -4536,7 +4542,7 @@ test textDisp-31.3 {line update index shifting} { lappend res [.t count -ypixels 1.0 end] set res } [list [expr {100+$fixedHeight*6}] \ - [expr {100+$fixedHeight*8}] \ + [expr {100+$fixedHeight*8}] \ [expr {$fixedHeight*9}] \ [expr {$fixedHeight*7}] \ [expr {100+$fixedHeight*6}]] @@ -4552,7 +4558,7 @@ test textDisp-31.4 {line embedded image height update} { lappend res [.t count -update -ypixels 1.0 end] set res } [list [expr {100+$fixedHeight*6}] \ - [expr {100+$fixedHeight*6}] \ + [expr {100+$fixedHeight*6}] \ [expr {$fixedHeight*7}]] test textDisp-31.5 {line update index shifting} { set res {} @@ -4570,7 +4576,7 @@ test textDisp-31.5 {line update index shifting} { lappend res [.t count -update -ypixels 1.0 end] set res } [list [expr {100+$fixedHeight*6}] \ - [expr {100+$fixedHeight*8}] \ + [expr {100+$fixedHeight*8}] \ [expr {$fixedHeight*9}] \ [expr {$fixedHeight*7}] \ [expr {100+$fixedHeight*6}]] @@ -4596,7 +4602,7 @@ test textDisp-31.6 {line update index shifting} { lappend res [.t count -ypixels 1.0 end] set res } [list [expr {100+$fixedHeight*6}] \ - [expr {100+$fixedHeight*8}] \ + [expr {100+$fixedHeight*8}] \ [expr {$fixedHeight*9}] \ [expr {$fixedHeight*7}] \ [expr {100+$fixedHeight*6}]] @@ -4620,7 +4626,7 @@ test textDisp-31.7 {line update index shifting, elided} { lappend res [.t count -ypixels 1.0 end] set res } [list [expr {$fixedHeight*1}] \ - [expr {$fixedHeight*3}] \ + [expr {$fixedHeight*3}] \ [expr {$fixedHeight*3}] \ [expr {$fixedHeight*2}] \ [expr {$fixedHeight*1}] \ @@ -4856,7 +4862,7 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { pack [text .t1] -expand 1 -fill both set txt "" for {set i 1} {$i < 100} {incr i} { - append txt "Line $i\n" + append txt "Line $i\n" } set result {} } -body { diff --git a/tests/textImage.test b/tests/textImage.test index ffc65e7..f3f9c19 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -123,8 +123,8 @@ test textImage-1.11 {basic argument checking} -setup { destroy .t } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t @@ -150,8 +150,8 @@ test textImage-1.13 {names argument checking} -setup { set result "" } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t @@ -181,8 +181,8 @@ test textImage-1.15 {align argument checking} -setup { destroy .t } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t @@ -196,8 +196,8 @@ test textImage-1.16 {configure} -setup { destroy .t } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t @@ -206,43 +206,43 @@ test textImage-1.16 {configure} -setup { } -cleanup { destroy .t image delete small -} -result {{-align {} {} center center} {-padx {} {} 0 0} {-pady {} {} 0 0} {-image {} {} {} small} {-name {} {} {} {}}} +} -result {{-align {} {} center center} {-padx {} {} 0 {}} {-pady {} {} 0 {}} {-image {} {} {} small} {-name {} {} {} {}}} test textImage-1.17 {basic cget options} -setup { destroy .t set result "" } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t .t image create end -image small foreach i {align padx pady image name} { - lappend result $i:[.t image cget small -$i] + lappend result $i:[.t image cget small -$i] } return $result } -cleanup { destroy .t image delete small -} -result {align:center padx:0 pady:0 image:small name:} +} -result {align:center padx: pady: image:small name:} test textImage-1.18 {basic configure options} -setup { destroy .t set result "" } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 - image create photo large -width 50 -height 50 - large put green -to 0 0 50 50 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 + image create photo large -width 50 -height 50 + large put green -to 0 0 50 50 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t .t image create end -image small foreach {option value} {align top padx 5 pady 7 image large name none} { - .t image configure small -$option $value + .t image configure small -$option $value } update .t image configure small @@ -255,8 +255,8 @@ test textImage-1.19 {basic image naming} -setup { destroy .t } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t @@ -274,8 +274,8 @@ test textImage-2.1 {debug} -setup { destroy .t } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t @@ -297,8 +297,8 @@ test textImage-3.1 {image change propagation} -setup { set result "" } -body { catch { - image create photo vary -width 5 -height 5 - vary put red -to 0 0 4 4 + image create photo vary -width 5 -height 5 + vary put red -to 0 0 4 4 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t @@ -306,9 +306,9 @@ test textImage-3.1 {image change propagation} -setup { update lappend result base:[.t bbox vary] foreach i {10 20 40} { - vary configure -width $i -height $i - update - lappend result $i:[.t bbox vary] + vary configure -width $i -height $i + update + lappend result $i:[.t bbox vary] } return $result } -cleanup { @@ -321,8 +321,8 @@ test textImage-3.2 {delayed image management, see also bug 1591493} -setup { set result "" } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t @@ -347,10 +347,10 @@ test textImage-4.1 {alignment checking - except baseline} -setup { set result "" } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 - image create photo large -width 50 -height 50 - large put green -to 0 0 50 50 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 + image create photo large -width 50 -height 50 + large put green -to 0 0 50 50 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t @@ -360,9 +360,9 @@ test textImage-4.1 {alignment checking - except baseline} -setup { update lappend result default:[.t bbox small] foreach i {top bottom center} { - .t image configure small -align $i - update - lappend result [.t image cget small -align]:[.t bbox small] + .t image configure small -align $i + update + lappend result [.t image cget small -align]:[.t bbox small] } return $result } -cleanup { @@ -375,10 +375,10 @@ test textImage-4.2 {alignment checking - baseline} -setup { set result "" } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 - image create photo large -width 50 -height 50 - large put green -to 0 0 50 50 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 + image create photo large -width 50 -height 50 + large put green -to 0 0 50 50 } font create test_font2 -size 5 text .t -font test_font2 -bd 0 -highlightthickness 0 -padx 0 -pady 0 @@ -390,16 +390,16 @@ test textImage-4.2 {alignment checking - baseline} -setup { # Sizes larger than 25 can be too big and lead to a negative 'norm', # at least on Windows XP with certain settings. foreach size {10 15 20 25} { - font configure test_font2 -size $size - array set Metrics [font metrics test_font2] - update ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events - update ; # services the queued "TkWorldChanged" events - foreach {x y w h} [.t bbox small] {} - set norm [expr { - (([image height large] - $Metrics(-linespace))/2 - + $Metrics(-ascent) - [image height small] - $y) - }] - lappend result "$size $norm" + font configure test_font2 -size $size + array set Metrics [font metrics test_font2] + update ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events + update ; # services the queued "TkWorldChanged" events + foreach {x y w h} [.t bbox small] {} + set norm [expr { + (([image height large] - $Metrics(-linespace))/2 + + $Metrics(-ascent) - [image height small] - $y) + }] + lappend result "$size $norm" } return $result } -cleanup { @@ -416,10 +416,10 @@ test textImage-4.3 {alignment and padding checking} -constraints { set result "" } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 - image create photo large -width 50 -height 50 - large put green -to 0 0 50 50 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 + image create photo large -width 50 -height 50 + large put green -to 0 0 50 50 } text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t @@ -429,9 +429,9 @@ test textImage-4.3 {alignment and padding checking} -constraints { update lappend result default:[.t bbox small] foreach i {top bottom center baseline} { - .t image configure small -align $i - update - lappend result $i:[.t bbox small] + .t image configure small -align $i + update + lappend result $i:[.t bbox small] } return $result } -cleanup { @@ -444,10 +444,10 @@ test textImage-5.1 {peer widget images} -setup { destroy .t .tt } -body { catch { - image create photo small -width 5 -height 5 - small put red -to 0 0 4 4 - image create photo large -width 50 -height 50 - large put green -to 0 0 50 50 + image create photo small -width 5 -height 5 + small put red -to 0 0 4 4 + image create photo large -width 50 -height 50 + large put green -to 0 0 50 50 } pack [text .t] toplevel .tt diff --git a/tests/textTag.test b/tests/textTag.test index 7818aee..ff51bac 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -388,7 +388,7 @@ test textTag-2.12 {TkTextTagCmd - "add" option} -body { test textTag-2.14 {tag add before -startline - Bug 1615425} -body { text .tt for {set i 1} {$i <10} {incr i} { - .tt insert end "Line $i\n" + .tt insert end "Line $i\n" } .tt tag configure mytag -offset 2 .tt peer create .ptt @@ -570,16 +570,16 @@ test textTag-5.12 {TkTextTagCmd - "configure" option} -body { test textTag-5.13 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -lmargin1 2 -lmargin2 4 -rmargin 5 \ - -lmargincolor darkblue -rmargincolor lightgreen + -lmargincolor darkblue -rmargincolor lightgreen list [.t tag configure x -lmargin1] [.t tag configure x -lmargin2] \ - [.t tag configure x -rmargin] [.t tag configure x -lmargincolor] \ - [.t tag configure x -rmargincolor] + [.t tag configure x -rmargin] [.t tag configure x -lmargincolor] \ + [.t tag configure x -rmargincolor] } -cleanup { .t tag delete x } -result [list {-lmargin1 {} {} {} 2} {-lmargin2 {} {} {} 4} \ - {-rmargin {} {} {} 5} \ - {-lmargincolor {} {} {} darkblue} {-rmargincolor {} {} {} lightgreen} \ - ] + {-rmargin {} {} {} 5} \ + {-lmargincolor {} {} {} darkblue} {-rmargincolor {} {} {} lightgreen} \ + ] test textTag-5.14 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -lmargin1 2.0x @@ -615,7 +615,7 @@ test textTag-5.17 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -spacing1 2 -spacing2 4 -spacing3 6 list [.t tag configure x -spacing1] [.t tag configure x -spacing2] \ - [.t tag configure x -spacing3] + [.t tag configure x -spacing3] } -cleanup { .t tag delete x } -result {{-spacing1 {} {} {} 2} {-spacing2 {} {} {} 4} {-spacing3 {} {} {} 6}} @@ -639,11 +639,11 @@ test textTag-5.20 {TkTextTagCmd - "configure" option} -body { } -returnCodes error -result {expected screen distance or "" but got "4.2.3"} test textTag-5.21 {TkTextTagCmd - "configure" option} -body { .t configure -selectborderwidth 2 -selectforeground blue \ - -selectbackground black + -selectbackground black .t tag configure sel -borderwidth 4 -foreground green -background yellow set x {} foreach i {-selectborderwidth -selectforeground -selectbackground} { - lappend x [lindex [.t configure $i] 4] + lappend x [lindex [.t configure $i] 4] } return $x } -result {4 green yellow} @@ -748,7 +748,7 @@ test textTag-7.4 {TkTextTagCmd - "lower" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { - .t tag configure $i -background black + .t tag configure $i -background black } } -body { .t tag lower c @@ -760,7 +760,7 @@ test textTag-7.5 {TkTextTagCmd - "lower" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { - .t tag configure $i -background black + .t tag configure $i -background black } } -body { .t tag lower d b @@ -772,7 +772,7 @@ test textTag-7.6 {TkTextTagCmd - "lower" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { - .t tag configure $i -background black + .t tag configure $i -background black } } -body { .t tag lower a c @@ -791,7 +791,7 @@ test textTag-8.2 {TkTextTagCmd - "names" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { - .t tag configure $i -background black + .t tag configure $i -background black } } -body { .t tag names @@ -802,7 +802,7 @@ test textTag-8.3 {TkTextTagCmd - "names" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { - .t tag configure $i -background black + .t tag configure $i -background black } } -body { .t tag add "a b" 2.1 2.6 @@ -1070,7 +1070,7 @@ test textTag-11.4 {TkTextTagCmd - "raise" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { - .t tag configure $i -background black + .t tag configure $i -background black } } -body { .t tag raise c @@ -1082,7 +1082,7 @@ test textTag-11.5 {TkTextTagCmd - "raise" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { - .t tag configure $i -background black + .t tag configure $i -background black } } -body { .t tag raise d b @@ -1094,7 +1094,7 @@ test textTag-11.6 {TkTextTagCmd - "raise" option} -setup { .t tag delete {*}[.t tag names] .t tag remove sel 1.0 end foreach i {a b c d} { - .t tag configure $i -background black + .t tag configure $i -background black } } -body { .t tag raise a c @@ -1164,7 +1164,7 @@ test textTag-14.1 {SortTags} -setup { .t tag delete a b c d } -body { foreach i {a b c d} { - .t tag add $i 2.0 2.2 + .t tag add $i 2.0 2.2 } .t tag names 2.1 } -cleanup { @@ -1175,10 +1175,10 @@ test textTag-14.2 {SortTags} -setup { .t tag delete a b c d } -body { foreach i {a b c d} { - .t tag configure $i -background black + .t tag configure $i -background black } foreach i {d c b a} { - .t tag add $i 2.0 2.2 + .t tag add $i 2.0 2.2 } .t tag names 2.1 } -cleanup { @@ -1188,7 +1188,7 @@ test textTag-14.3 {SortTags} -setup { .t tag delete {*}[.t tag names] } -body { for {set i 0} {$i < 30} {incr i} { - .t tag add x$i 2.0 2.2 + .t tag add x$i 2.0 2.2 } .t tag names 2.1 } -cleanup { @@ -1198,10 +1198,10 @@ test textTag-14.4 {SortTags} -setup { .t tag delete {*}[.t tag names] } -body { for {set i 0} {$i < 30} {incr i} { - .t tag configure x$i -background black + .t tag configure x$i -background black } for {set i 29} {$i >= 0} {incr i -1} { - .t tag add x$i 2.0 2.2 + .t tag add x$i 2.0 2.2 } .t tag names 2.1 } -cleanup { @@ -1373,15 +1373,15 @@ test textTag-16.2 {TkTextPickCurrent procedure} -constraints { test textTag-16.3 {TkTextPickCurrent procedure} -setup { foreach i {a b c d} { - .t tag remove $i 1.0 end + .t tag remove $i 1.0 end } wm geometry . +200+200 ; update event generate {} <Motion> -warp 1 -x 5 -y 5 controlPointerWarpTiming } -body { foreach i {a b c d} { - .t tag bind $i <Enter> "lappend x enter-$i" - .t tag bind $i <Leave> "lappend x leave-$i" + .t tag bind $i <Enter> "lappend x enter-$i" + .t tag bind $i <Leave> "lappend x leave-$i" } .t tag lower b .t tag lower a @@ -1402,15 +1402,15 @@ test textTag-16.3 {TkTextPickCurrent procedure} -setup { test textTag-16.4 {TkTextPickCurrent procedure} -setup { foreach i {a b c d} { - .t tag remove $i 1.0 end + .t tag remove $i 1.0 end } wm geometry . +200+200 ; update event generate {} <Motion> -warp 1 -x 5 -y 5 controlPointerWarpTiming } -body { foreach i {a b c d} { - .t tag bind $i <Enter> "lappend x enter-$i" - .t tag bind $i <Leave> "lappend x leave-$i" + .t tag bind $i <Enter> "lappend x enter-$i" + .t tag bind $i <Leave> "lappend x leave-$i" } .t tag lower b .t tag lower a @@ -1430,7 +1430,7 @@ test textTag-16.4 {TkTextPickCurrent procedure} -setup { test textTag-16.5 {TkTextPickCurrent procedure} -setup { foreach i {big a b c d} { - .t tag remove $i 1.0 end + .t tag remove $i 1.0 end } wm geometry . +200+200 ; update event generate {} <Motion> -warp 1 -x 5 -y 5 @@ -1450,7 +1450,7 @@ test textTag-16.6 {TkTextPickCurrent procedure} -constraints { haveBigFontTwiceLargerThanTextFont } -setup { foreach i {big a b c d} { - .t tag remove $i 1.0 end + .t tag remove $i 1.0 end } wm geometry . +200+200 ; update event generate {} <Motion> -warp 1 -x 5 -y 5 @@ -1471,7 +1471,7 @@ test textTag-16.7 {TkTextPickCurrent procedure} -constraints { haveBigFontTwiceLargerThanTextFont } -setup { foreach i {big a b c d} { - .t tag remove $i 1.0 end + .t tag remove $i 1.0 end } wm geometry . +200+200 ; update event generate {} <Motion> -warp 1 -x 5 -y 5 diff --git a/tests/textWind.test b/tests/textWind.test index ecb433e..56525fd 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -96,7 +96,7 @@ test textWind-1.1 {basic tests of options} -setup { .t window create 2.2 -window .f update list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \ - [.t window configure .f -window] + [.t window configure .f -window] } -result [list \ 1 \ 3x3+[xchar 2]+[expr {[yline 2]+($fixedHeight-3)/2}] \ @@ -112,7 +112,7 @@ test textWind-1.2 {basic tests of options} -setup { .t window create 2.2 -window .f -align top update list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \ - [.t window configure .f -align] + [.t window configure .f -align] } -result [list \ 1 \ 3x3+[xchar 2]+[yline 2] \ @@ -258,7 +258,7 @@ test textWind-2.13 {TkTextWindowCmd procedure} -setup { .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 update list [.t window configure .f -padx 14 -pady 15] \ - [.t window configure .f -padx] [.t window configure .f -pady] + [.t window configure .f -padx] [.t window configure .f -pady] } -cleanup { destroy .f } -result {{} {-padx {} {} 0 14} {-pady {} {} 0 15}} @@ -287,7 +287,7 @@ test textWind-2.17 {TkTextWindowCmd procedure} -setup { .t delete 1.0 end } -body { list [catch {.t window create 1.0} msg] $msg [.t window configure 1.0] -} -result {0 {} {{-align {} {} center center} {-create {} {} {} {}} {-padx {} {} 0 0} {-pady {} {} 0 0} {-stretch {} {} 0 0} {-window {} {} {} {}}}} +} -result {0 {} {{-align {} {} center center} {-create {} {} {} {}} {-padx {} {} 0 {}} {-pady {} {} 0 {}} {-stretch {} {} 0 0} {-window {} {} {} {}}}} test textWind-2.18 {TkTextWindowCmd procedure} -setup { destroy .f frame .f -width 20 -height 10 -bg $color @@ -343,8 +343,8 @@ test textWind-2.25 {TkTextWindowCmd procedure, "names" option} -setup { destroy .f .f2 .t.f .t.f2 } -body { foreach i {.f .f2 .t.f .t.f2} { - frame $i -width 20 -height 20 - .t window create end -window $i + frame $i -width 20 -height 20 + .t window create end -window $i } lsort [.t window names] } -cleanup { @@ -693,7 +693,7 @@ test textWind-10.1 {EmbWinLayoutProc procedure} -setup { } -body { .t insert 1.0 "Some sample text" .t window create 1.5 -create { - frame .f -width 10 -height 20 -bg $color + frame .f -width 10 -height 20 -bg $color } update list [winfo exists .f] [winfo width .f] [winfo height .f] [.t index .f] @@ -704,13 +704,13 @@ test textWind-10.1 {EmbWinLayoutProc procedure} -setup { test textWind-10.2 {EmbWinLayoutProc procedure, error in creating window} -setup { .t delete 1.0 end proc bgerror args { - global msg - set msg $args + global msg + set msg $args } } -body { .t insert 1.0 "Some sample text" .t window create 1.5 -create { - error "couldn't create window" + error "couldn't create window" } set msg xyzzy update @@ -724,13 +724,13 @@ test textWind-10.2 {EmbWinLayoutProc procedure, error in creating window} -setup test textWind-10.3 {EmbWinLayoutProc procedure, error in creating window} -setup { .t delete 1.0 end proc bgerror args { - global msg - set msg $args + global msg + set msg $args } } -body { .t insert 1.0 "Some sample text" .t window create 1.5 -create { - concat gorp + concat gorp } set msg xyzzy update @@ -745,24 +745,24 @@ test textWind-10.4 {EmbWinLayoutProc procedure, error in creating window} -setup .t delete 1.0 end destroy .t.f proc bgerror args { - global msg + global msg lappend msg $args } } -body { .t insert 1.0 "Some sample text" set msg {} after idle { - .t window create 1.5 -create { - frame .t.f - frame .t.f.f -width 10 -height 20 -bg $color - } + .t window create 1.5 -create { + frame .t.f + frame .t.f.f -width 10 -height 20 -bg $color + } } set count 0 while {([llength $msg] < 2) && ($count < 100)} { - update - incr count - .t bbox 1.5 - after 10 + update + incr count + .t bbox 1.5 + after 10 } lappend msg [.t bbox 1.5] [winfo exists .t.f.f] } -cleanup { @@ -777,8 +777,8 @@ test textWind-10.5 {EmbWinLayoutProc procedure, error in creating window} -setup .t delete 1.0 end destroy .t.f proc bgerror args { - global msg - if {$msg == ""} { + global msg + if {$msg == ""} { lappend msg $args } } @@ -786,8 +786,8 @@ test textWind-10.5 {EmbWinLayoutProc procedure, error in creating window} -setup .t insert 1.0 "Some sample text" set msg {} .t window create 1.5 -create { - frame .t.f - frame .t.f.f -width 10 -height 20 -bg $color + frame .t.f + frame .t.f.f -width 10 -height 20 -bg $color } update lappend msg [winfo exists .t.f.f] @@ -799,16 +799,16 @@ test textWind-10.5 {EmbWinLayoutProc procedure, error in creating window} -setup test textWind-10.6 {EmbWinLayoutProc procedure, error in creating window} -setup { .t delete 1.0 end proc bgerror args { - global msg - if {[lsearch -exact $msg $args] < 0} { - lappend msg $args - } + global msg + if {[lsearch -exact $msg $args] < 0} { + lappend msg $args + } } } -body { .t insert 1.0 "Some sample text" update .t window create 1.5 -create { - concat .t + concat .t } set msg {} update @@ -823,15 +823,15 @@ test textWind-10.7 {EmbWinLayoutProc procedure, error in creating window} -setup .t delete 1.0 end destroy .t2 proc bgerror args { - global msg + global msg lappend msg $args } } -body { .t insert 1.0 "Some sample text" .t window create 1.5 -create { - toplevel .t2 -width 100 -height 150 - wm geom .t2 +0+0 - concat .t2 + toplevel .t2 -width 100 -height 150 + wm geom .t2 +0+0 + concat .t2 } set msg {} update idletasks ; after 100 ; update @@ -846,15 +846,15 @@ test textWind-10.8 {EmbWinLayoutProc procedure, error in creating window} -setup .t delete 1.0 end destroy .t2 proc bgerror args { - global msg + global msg lappend msg $args } } -body { .t insert 1.0 "Some sample text" .t window create 1.5 -create { - toplevel .t2 -width 100 -height 150 - wm geom .t2 +0+0 - concat .t2 + toplevel .t2 -width 100 -height 150 + wm geom .t2 +0+0 + concat .t2 } set msg {} update @@ -1340,7 +1340,7 @@ test textWind-15.2 {TkTextWindowIndex procedure} -setup { destroy .f } -body { .t configure -spacing1 0 -spacing2 0 -spacing3 0 \ - -wrap none + -wrap none .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.6 -window .f @@ -1373,7 +1373,7 @@ test textWind-16.2 {EmbWinTextStructureProc procedure} -setup { destroy .f .f2 } -body { .t configure -spacing1 0 -spacing2 0 -spacing3 0 \ - -wrap none + -wrap none .t insert 1.0 "Some sample text" frame .f -width 30 -height 20 -bg $color .t window create 1.6 -window .f @@ -1409,7 +1409,7 @@ test textWind-16.4 {EmbWinTextStructureProc procedure} -setup { .t delete 1.0 end } -body { .t configure -spacing1 0 -spacing2 0 -spacing3 0 \ - -wrap none + -wrap none .t insert 1.0 "Some sample text" frame .t.f -width 30 -height 20 -bg $color .t window create 1.6 -window .t.f @@ -1510,7 +1510,7 @@ test textWind-17.6 {peer widget window configuration} -setup { .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} update list [.t window configure 1.2 -window] \ - [.tt.t window configure 1.2 -window] + [.tt.t window configure 1.2 -window] } -cleanup { destroy .tt .t } -result {{-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}} @@ -1541,7 +1541,7 @@ test textWind-17.8 {peer widget window configuration} -setup { .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] update list [.t window configure 1.2 -window] \ - [.tt.t window configure 1.2 -window] + [.tt.t window configure 1.2 -window] } -cleanup { destroy .tt .t } -result {{-window {} {} {} .t.f} {-window {} {} {} {}}} diff --git a/tests/tk.test b/tests/tk.test index 0316a7b..4fdec1f 100644 --- a/tests/tk.test +++ b/tests/tk.test @@ -74,12 +74,12 @@ test tk-3.9 {tk command: scaling: too big} -body { test tk-3.10 {tk command: scaling: widthmm} -body { tk scaling 1.25 expr {int((25.4*[winfo screenwidth .])/(72*1.25) + 0.5) \ - - [winfo screenmmwidth .]} + - [winfo screenmmwidth .]} } -result 0 test tk-3.11 {tk command: scaling: heightmm} -body { tk scaling 1.25 expr {int((25.4*[winfo screenheight .])/(72*1.25) + 0.5) \ - - [winfo screenmmheight .]} + - [winfo screenmmheight .]} } -result 0 tk scaling $scaling diff --git a/tests/ttk/image.test b/tests/ttk/image.test index 51f0f00..8d58a12 100644 --- a/tests/ttk/image.test +++ b/tests/ttk/image.test @@ -5,7 +5,7 @@ loadTestedCommands test image-1.1 "Bad image element" -body { ttk::style element create BadImage image badimage -} -returnCodes error -result {image "badimage" doesn't exist} +} -returnCodes error -result {image "badimage" does not exist} test image-1.2 "Duplicate element" -setup { image create photo test.element -width 10 -height 10 diff --git a/tests/ttk/labelframe.test b/tests/ttk/labelframe.test index f7cb8ef..b82d2c3 100644 --- a/tests/ttk/labelframe.test +++ b/tests/ttk/labelframe.test @@ -11,13 +11,13 @@ test labelframe-2.1 "Can't use indirect descendant as labelwidget" -body { ttk::frame .lf.t ttk::checkbutton .lf.t.cb .lf configure -labelwidget .lf.t.cb -} -returnCodes error -result "can't *" -match glob \ +} -returnCodes error -result {cannot add ".lf.t.cb" as content of ".lf"} \ -cleanup { destroy .lf.t } ; test labelframe-2.2 "Can't use toplevel as labelwidget" -body { toplevel .lf.t .lf configure -labelwidget .lf.t -} -returnCodes error -result "can't *" -match glob \ +} -returnCodes error -result {cannot add ".lf.t" as content of ".lf"} \ -cleanup { destroy .lf.t } ; test labelframe-2.3 "Can't use non-windows as -labelwidget" -body { diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index f4558bf..152625b 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -25,7 +25,7 @@ test notebook-1.3 "Cannot add toplevel" -body { .nb add [toplevel .nb.t] } -cleanup { destroy .t.nb -} -returnCodes error -match glob -result "can't add .nb.t*" +} -returnCodes error -result {cannot add ".nb.t" as content of ".nb"} test notebook-1.4 "Try to select bad tab" -body { .nb select @6000,6000 diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test index d115a9e..10e1188 100644 --- a/tests/ttk/panedwindow.test +++ b/tests/ttk/panedwindow.test @@ -135,11 +135,11 @@ test panedwindow-3.0 "configure pane" -body { test panedwindow-3.1 "configure pane -- errors" -body { .pw pane 1 -weight -4 -} -returnCodes error -match glob -result "-weight must be nonnegative" +} -returnCodes error -match glob -result "-weight must be non-negative" test panedwindow-3.2 "add pane -- errors" -body { .pw add [ttk::label .pw.l] -weight -1 -} -returnCodes error -match glob -result "-weight must be nonnegative" +} -returnCodes error -match glob -result "-weight must be non-negative" test panedwindow-3.end "cleanup" -body { destroy .pw } diff --git a/tests/ttk/pb_image.svg b/tests/ttk/pb_image.svg index b5956f5..2094eb9 100644 --- a/tests/ttk/pb_image.svg +++ b/tests/ttk/pb_image.svg @@ -49,11 +49,11 @@ id="metadata5"> <rdf:RDF> <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> diff --git a/tests/ttk/progressbar.test b/tests/ttk/progressbar.test index 9f9e5f9..b3f1dc6 100644 --- a/tests/ttk/progressbar.test +++ b/tests/ttk/progressbar.test @@ -89,8 +89,8 @@ test progressbar-3.1 "progressbar non-core options" -setup { ttk::progressbar .defaultpb } -body { foreach option {-anchor -foreground -justify -style -text -wraplength \ - -length -maximum -mode -orient -phase -value -variable} { - lappend res [.defaultpb cget $option] + -length -maximum -mode -orient -phase -value -variable} { + lappend res [.defaultpb cget $option] } set res } -cleanup { @@ -104,17 +104,17 @@ test progressbar-3.2 "TIP #442 options are taken into account" -setup { set thefont [font actual {Arial 10}] } -body { .p configure -anchor c -foreground blue -justify right \ - -text "TIP #442\noptions are now tested" -wraplength 100 + -text "TIP #442\noptions are now tested" -wraplength 100 update .p step 10 .p configure -anchor e -font $thefont -foreground green -justify center \ - -text "Changing the value of each option\nfrom TIP #442" -wraplength 250 + -text "Changing the value of each option\nfrom TIP #442" -wraplength 250 update .p step 20 .p configure -orient vertical -text "Cannot be seen" update foreach option {-anchor -foreground -justify -text -wraplength} { - lappend res [list $option [.p cget $option]] + lappend res [list $option [.p cget $option]] } set res } -cleanup { @@ -148,7 +148,7 @@ test progressbar-4.1 "style command" -body { ttk::progressbar .wh ; # default is -orient horizontal ttk::progressbar .wv -orient vertical list [.wh cget -style] [.wh style] [winfo class .wh]\ - [.wv cget -style] [.wv style] [winfo class .wv] + [.wv cget -style] [.wv style] [winfo class .wv] } -cleanup { destroy .wh .wv } -result {{} Horizontal.TProgressbar TProgressbar {} Vertical.TProgressbar TProgressbar} diff --git a/tests/ttk/spinbox.test b/tests/ttk/spinbox.test index 1f32049..030a344 100644 --- a/tests/ttk/spinbox.test +++ b/tests/ttk/spinbox.test @@ -213,12 +213,12 @@ test spinbox-3.0 "textarea should expand to fill widget" -setup { update idletasks set timer [after 500 {set ::spinbox_test timedout}] bind . <Map> { - after idle { - wm geometry . "210x80" + after idle { + wm geometry . "210x80" update idletasks - set ::spinbox_test [.sb identify element 25 5] - } - bind . <Map> {} + set ::spinbox_test [.sb identify element 25 5] + } + bind . <Map> {} } grid .sb -sticky ew vwait ::spinbox_test @@ -234,12 +234,12 @@ test spinbox-4.0 "Increment with duplicates in -values, wrap" -setup { } -body { set ::spinbox_test [.sb get] for {set i 0} {$i < $max} {incr i} { - event generate .sb <<Increment>> - lappend ::spinbox_test [.sb get] + event generate .sb <<Increment>> + lappend ::spinbox_test [.sb get] } for {set i 0} {$i < $max} {incr i} { - event generate .sb <<Decrement>> - lappend ::spinbox_test [.sb get] + event generate .sb <<Decrement>> + lappend ::spinbox_test [.sb get] } set ::spinbox_test } -cleanup { @@ -254,13 +254,13 @@ test spinbox-4.1 "Increment with duplicates in -values, wrap, initial value set" .sb set three set ::spinbox_test [.sb get] for {set i 0} {$i < $max} {incr i} { - event generate .sb <<Increment>> - lappend ::spinbox_test [.sb get] + event generate .sb <<Increment>> + lappend ::spinbox_test [.sb get] } .sb set two ; # the first "two" in the -values list becomes the current value for {set i 0} {$i < $max} {incr i} { - event generate .sb <<Decrement>> - lappend ::spinbox_test [.sb get] + event generate .sb <<Decrement>> + lappend ::spinbox_test [.sb get] } set ::spinbox_test } -cleanup { @@ -274,12 +274,12 @@ test spinbox-4.2 "Increment with duplicates in -values, no wrap" -setup { } -body { set ::spinbox_test [.sb get] for {set i 0} {$i < $max} {incr i} { - event generate .sb <<Increment>> - lappend ::spinbox_test [.sb get] + event generate .sb <<Increment>> + lappend ::spinbox_test [.sb get] } for {set i 0} {$i < $max} {incr i} { - event generate .sb <<Decrement>> - lappend ::spinbox_test [.sb get] + event generate .sb <<Decrement>> + lappend ::spinbox_test [.sb get] } set ::spinbox_test } -cleanup { diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test index d92a979..36749d7 100644 --- a/tests/ttk/treeview.test +++ b/tests/ttk/treeview.test @@ -27,7 +27,7 @@ proc consistencyCheck {tv {item {}}} { proc assert {expr {message ""}} { if {![uplevel 1 [list expr $expr]]} { - set error "PANIC! PANIC! PANIC: $message ($expr failed)" + set error "PANIC! PANIC! PANIC: $message ($expr failed)" puts stderr $error error $error } @@ -54,12 +54,12 @@ proc tvSetupWithItems {} { .tv insert nn end -id nn.n2 -text "nn.3" .tv insert nn end -id nn.n3 -text "nn.3" for {set t 2} {$t < 100} {incr t} { - .tv insert {} end -id nn$t -text "nn$t" - if {$t % 3 == 0} { - .tv insert nn$t end -id nn$t.n1 -text "nn$t.n1" - .tv insert nn$t end -id nn$t.n2 -text "nn$t.n2" - .tv insert nn$t end -id nn$t.n3 -text "nn$t.n3" - } + .tv insert {} end -id nn$t -text "nn$t" + if {$t % 3 == 0} { + .tv insert nn$t end -id nn$t.n1 -text "nn$t.n1" + .tv insert nn$t end -id nn$t.n2 -text "nn$t.n2" + .tv insert nn$t end -id nn$t.n3 -text "nn$t.n3" + } } } @@ -627,7 +627,7 @@ test treeview-9.0 "scroll callback - empty tree" -body { test treeview-9.1 "scrolling" -setup { pack [ttk::treeview .tree -show tree] -fill y for {set i 1} {$i < 100} {incr i} { - .tree insert {} end -text $i + .tree insert {} end -text $i } } -body { .tree yview scroll 5 units @@ -642,19 +642,19 @@ test treeview-9.1 "scrolling" -setup { test treeview-9.2 {scrolling on see command - bug [14188104c3]} -setup { toplevel .top ttk::treeview .top.tree -show {} -height 10 -columns {label} \ - -yscrollcommand [list .top.vs set] + -yscrollcommand [list .top.vs set] ttk::scrollbar .top.vs -command {.top.tree yview} grid .top.tree -row 0 -column 0 -sticky ns grid .top.vs -row 0 -column 1 -sticky ns update proc setrows {n} { - .top.tree delete [.top.tree children {}] - for {set i 1} {$i <= $n} {incr i} { - .top.tree insert {} end -id row$i \ - -values [list [format "Row %2.2d" $i]] - } - .top.tree see row1 - update idletasks + .top.tree delete [.top.tree children {}] + for {set i 1} {$i <= $n} {incr i} { + .top.tree insert {} end -id row$i \ + -values [list [format "Row %2.2d" $i]] + } + .top.tree see row1 + update idletasks } } -body { setrows 10 @@ -668,7 +668,7 @@ test treeview-9.2 {scrolling on see command - bug [14188104c3]} -setup { test treeview-9.3 {scrolling on see command, requested item is closed} -setup { toplevel .top ttk::treeview .top.tree -show tree -height 10 -columns {label} \ - -yscrollcommand [list .top.vs set] + -yscrollcommand [list .top.vs set] ttk::scrollbar .top.vs -command {.top.tree yview} grid .top.tree -row 0 -column 0 -sticky ns grid .top.vs -row 0 -column 1 -sticky ns @@ -679,8 +679,8 @@ test treeview-9.3 {scrolling on see command, requested item is closed} -setup { .top.tree insert c end -id d -text d .top.tree insert d end -id e -text e for {set i 6} {$i <= 15} {incr i} { - .top.tree insert {} end -id row$i \ - -values [list [format "Row %2.2d" $i]] + .top.tree insert {} end -id row$i \ + -values [list [format "Row %2.2d" $i]] } update } -body { @@ -688,10 +688,39 @@ test treeview-9.3 {scrolling on see command, requested item is closed} -setup { .top.tree see e update idletasks set after [lindex [.top.vs get] 1] - expr $after < $before + expr ($after < $before) } -cleanup { destroy .top } -result 1 +test treeview-9.4 {no scrolling on see command on an item below a detached item; bbox on such item is empty} -setup { + toplevel .top + ttk::treeview .top.tree -show tree -height 10 -columns {label} \ + -yscrollcommand [list .top.vs set] + ttk::scrollbar .top.vs -command {.top.tree yview} + grid .top.tree -row 0 -column 0 -sticky ns + grid .top.vs -row 0 -column 1 -sticky ns + + foreach dir {A B C D E F G H} { + set id [string cat dir $dir] + .top.tree insert {} end -id $id -text "dir $dir" -open 1 + for {set i 1} {$i <= 10} {incr i} { + .top.tree insert $id end -id $id-$i -text "dir $dir item $i" + } + } + update + .top.tree detach dirD + .top.tree item dirC -open 0 + update +} -body { + set before [lindex [.top.vs get] 1] + .top.tree see dirD-4 + update + set after [lindex [.top.vs get] 1] + set res [expr ($after == $before)] + lappend res [.top.tree bbox dirD-4] +} -cleanup { + destroy .top +} -result {1 {}} test treeview-10.0 "See command" -setup { # Setup common for all 10.* tests @@ -699,10 +728,10 @@ test treeview-10.0 "See command" -setup { tvSetupWithItems set ::baseBbY [lindex [.tv bbox nn "#1"] 1] proc bbY {item} { - set bb [.tv bbox $item "#1"] - set y [lindex $bb 1] - if {$y eq ""} {return "_"} - return [expr {$y - $::baseBbY}] + set bb [.tv bbox $item "#1"] + set y [lindex $bb 1] + if {$y eq ""} {return "_"} + return [expr {$y - $::baseBbY}] } } -body { set res "" @@ -784,29 +813,29 @@ test treeview-11.5 "Cellselection add rectangle" -body { .tv cellselection add "nn a" "nn.n1 c" .tv cellselection } -result [list \ - "nn a" "nn b" "nn c" \ - "nn.n1 a" "nn.n1 b" "nn.n1 c" \ - "nn.n3 b" \ - "nn2 b"] + "nn a" "nn b" "nn c" \ + "nn.n1 a" "nn.n1 b" "nn.n1 c" \ + "nn.n3 b" \ + "nn2 b"] test treeview-11.6 "Cellselection toggle rectangle" -body { .tv cellselection toggle "nn.n1 b" "nn.n3 c" .tv cellselection } -result [list \ - "nn a" "nn b" "nn c" \ - "nn.n1 a" \ - "nn.n2 b" "nn.n2 c" \ - "nn.n3 c" \ - "nn2 b"] + "nn a" "nn b" "nn c" \ + "nn.n1 a" \ + "nn.n2 b" "nn.n2 c" \ + "nn.n3 c" \ + "nn2 b"] test treeview-11.7 "Cellselection remove rectangle" -body { .tv cellselection remove "nn.n1 a" "nn.n3 b" .tv cellselection } -result [list \ - "nn a" "nn b" "nn c" \ - "nn.n2 c" \ - "nn.n3 c" \ - "nn2 b"] + "nn a" "nn b" "nn c" \ + "nn.n2 c" \ + "nn.n3 c" \ + "nn2 b"] test treeview-11.8 "Cellselection set rectangle" -body { # This tests that "set" clears out all old selections @@ -1048,7 +1077,7 @@ test treeview-identify-10 "identify works when horizontally scrolled" -setup { set result [list] foreach xoffs {0 25 50} { .tv xview $xoffs - update + update lappend result [identify* .tv {region column} 10 10 60 10] lappend result [identify* .tv {region column} 10 50 60 50] } @@ -1067,22 +1096,22 @@ test treeview-identify-10b "bbox works when horizontally scrolled" -body { set base [lindex [.tv bbox branch "#0"] 0] set result [list] foreach tc {0 1 2 3} { - .tv configure -titlecolumns $tc - foreach xoffs {0 25 50} { - .tv xview $xoffs - update - # Extract x coordinate for each column - lappend result [expr {[lindex [.tv bbox branch "#0"] 0] - $base}] - lappend result [expr {[lindex [.tv bbox branch A ] 0] - $base}] - lappend result [expr {[lindex [.tv bbox branch B ] 0] - $base}] - lappend result [expr {[lindex [.tv bbox branch C ] 0] - $base}] - } + .tv configure -titlecolumns $tc + foreach xoffs {0 25 50} { + .tv xview $xoffs + update + # Extract x coordinate for each column + lappend result [expr {[lindex [.tv bbox branch "#0"] 0] - $base}] + lappend result [expr {[lindex [.tv bbox branch A ] 0] - $base}] + lappend result [expr {[lindex [.tv bbox branch B ] 0] - $base}] + lappend result [expr {[lindex [.tv bbox branch C ] 0] - $base}] + } } set result } -result [list 0 50 100 150 -25 25 75 125 -50 0 50 100 \ - 0 50 100 150 0 25 75 125 0 0 50 100 \ - 0 50 100 150 0 50 75 125 0 50 50 100 \ - 0 50 100 150 0 50 100 125 0 50 100 101] + 0 50 100 150 0 25 75 125 0 0 50 100 \ + 0 50 100 150 0 50 75 125 0 50 50 100 \ + 0 50 100 150 0 50 100 125 0 50 100 101] # Followup to trigger crash that happened when title > display test treeview-identify-10c "title more than display" -body { @@ -1113,19 +1142,19 @@ test treeview-identify-11 "bbox supporting -height" -body { set base [lindex [.tv bbox branch A] 1] set result {} foreach yv {0 1} { - .tv yview $yv - update - foreach item {item1 item2 item3} { - set bb [.tv bbox $item A] - set y [lindex $bb 1] - if {$y eq ""} { - # This is to get a clearer error if this goes wrong - lappend result {} - } else { - lappend result [expr {$y - $base}] - } - lappend result [lindex $bb 3] - } + .tv yview $yv + update + foreach item {item1 item2 item3} { + set bb [.tv bbox $item A] + set y [lindex $bb 1] + if {$y eq ""} { + # This is to get a clearer error if this goes wrong + lappend result {} + } else { + lappend result [expr {$y - $base}] + } + lappend result [lindex $bb 3] + } } set result } -result [list 40 40 80 20 100 20 20 40 60 20 80 20] @@ -1260,8 +1289,8 @@ test treeview-368fa4561e "indicators cannot be clicked on leafs" -setup { # using $h even for x computation is intentional here in order to simulate # a mouse click on the (invisible since we're on a leaf) indicator event generate .tv <Button-1> \ - -x [expr {$x + $h / 2}] \ - -y [expr {$y + $h / 2}] + -x [expr {$x + $h / 2}] \ + -y [expr {$y + $h / 2}] lappend res [.tv item foo -open] .tv insert foo end -text "sub" lappend res [.tv item foo -open] @@ -1283,7 +1312,7 @@ test treeview-ce470f20fd-1 "dragging further than the right edge of the treeview proc nostretch {tv} { foreach col [$tv cget -columns] { - $tv column $col -stretch 0 + $tv column $col -stretch 0 } $tv column #0 -stretch 0 update idletasks ; # redisplay $tv @@ -1292,7 +1321,7 @@ proc nostretch {tv} { test treeview-ce470f20fd-2 "changing -stretch resizes columns" -setup { pack [ttk::treeview .tv -columns {bar colA colB colC foo}] foreach col [.tv cget -columns] { - .tv heading $col -text $col + .tv heading $col -text $col } nostretch .tv .tv column colA -width 50 ; .tv column colB -width 50 ; # slack created @@ -1312,7 +1341,7 @@ test treeview-ce470f20fd-2 "changing -stretch resizes columns" -setup { test treeview-ce470f20fd-3 "changing -stretch resizes columns" -setup { pack [ttk::treeview .tv -columns {bar colA colB colC foo}] foreach col [.tv cget -columns] { - .tv heading $col -text $col + .tv heading $col -text $col } .tv configure -displaycolumns {colB colA colC} nostretch .tv @@ -1333,7 +1362,7 @@ test treeview-ce470f20fd-3 "changing -stretch resizes columns" -setup { test treeview-ce470f20fd-4 "changing -stretch resizes columns" -setup { pack [ttk::treeview .tv -columns {bar colA colB colC foo}] foreach col [.tv cget -columns] { - .tv heading $col -text $col + .tv heading $col -text $col } .tv configure -displaycolumns {colB colA colC} nostretch .tv @@ -1352,7 +1381,7 @@ test treeview-ce470f20fd-4 "changing -stretch resizes columns" -setup { .tv configure -displaycolumns {bar colC colA colB} update idletasks ; # no slack anymore because the widget resizes (shrinks) lappend res [.tv column bar -width] [.tv column colA -width] \ - [expr {[winfo width .tv] < $origTreeWidth}] + [expr {[winfo width .tv] < $origTreeWidth}] } -cleanup { destroy .tv } -result {60 50 60 50 60 50 1} @@ -1392,9 +1421,9 @@ test treeview-column0-leak "Test for leak in tree column" -setup { set heading [string range _Hej_ 1 3] } -body { for {set t 0} {$t < 3} {incr t} { - ttk::treeview .tapa -columns "hej hopp" - .tapa heading #0 -text $heading - destroy .tapa + ttk::treeview .tapa -columns "hej hopp" + .tapa heading #0 -text $heading + destroy .tapa } tcl::unsupported::representation $heading } -match glob -result {*refcount of 3,*} @@ -1424,11 +1453,11 @@ test treeview-22.1 "tag bindings" -setup { .tv tag cell add t2 "nn.n2 c" update proc cellEvent {item col} { - # Find midpoint of cell - lassign [.tv bbox $item $col] aX aY aW aH - set aX [expr {$aX + $aW / 2}] - set aY [expr {$aY + $aH / 2}] - event generate .tv <Button-1> -x $aX -y $aY + # Find midpoint of cell + lassign [.tv bbox $item $col] aX aY aW aH + set aX [expr {$aX + $aW / 2}] + set aY [expr {$aY + $aH / 2}] + event generate .tv <Button-1> -x $aX -y $aY } } -body { .tv tag bind t1 <Button-1> {lappend ::tagtest t1} @@ -1470,7 +1499,7 @@ test treeview-23.1 "cell padding" -setup { } -body { .tv tag cell add mytag "nn b" set redcross [image create photo -format gif -data {R0lGODlhBwAHAIABAP8AAP/// - yH5BAEKAAEALAAAAAAHAAcAAAIMBIKmsWrIXnLxuDMLADs=}] + yH5BAEKAAEALAAAAAAHAAcAAAIMBIKmsWrIXnLxuDMLADs=}] .tv tag configure mytag -image $redcross .tv tag configure mytag -imageanchor nw .tv tag configure mytag -padding {2 4 6 8} diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test index 6963a2a..afe147e 100644 --- a/tests/ttk/ttk.test +++ b/tests/ttk/ttk.test @@ -136,6 +136,8 @@ test ttk-selfdestruct-ok-1 "Intentional self-destruction" -body { # Basic tests. # test ttk-1.1 "Create multiline button showing justified text" -body { + wm geometry . +100+100 + event generate . <Motion> -warp 1 -x 600 -y 600 pack [ttk::button .t -text "Hello\nWorld!!" -justify center] -expand true -fill both update } @@ -152,6 +154,8 @@ test ttk-1.4 "Original style preserved" -body { .t cget -style } -result "" +# Tests using this will fail if the top-level window contains the cursor + proc checkstate {w} { foreach statespec { {!active !disabled} @@ -166,7 +170,6 @@ proc checkstate {w} { set result } -# NB: this will fail if the top-level window pops up underneath the cursor test ttk-2.0 "Check state" -body { checkstate .t } -result [list 1 0 0 0 0 0] @@ -388,12 +391,12 @@ test ttk-8.4 "ImageChanged" -body { test ttk-9.1 "Traces on nonexistant namespaces" -body { ttk::checkbutton .tcb -variable foo::bar -} -returnCodes error -result "*parent namespace doesn't exist*" -match glob +} -returnCodes error -result {can't trace "foo::bar": parent namespace doesn't exist} test ttk-9.2 "Traces on nonexistant namespaces II" -body { ttk::checkbutton .tcb -variable X .tcb configure -variable foo::bar -} -returnCodes error -result "*parent namespace doesn't exist*" -match glob +} -returnCodes error -result {can't trace "foo::bar": parent namespace doesn't exist} test ttk-9.3 "Restore saved options on configure error" -body { .tcb cget -variable @@ -666,7 +669,7 @@ test ttk-ensemble-5 "style element create: valid" -body { test ttk-16.1 {ttk::style theme styles - no such theme} -body { ttk::style theme styles noSuchTheme -} -returnCodes 1 -result {theme "noSuchTheme" doesn't exist} +} -returnCodes 1 -result {theme "noSuchTheme" does not exist} test ttk-16.2 {ttk::style theme styles - theme exists} -body { # simply check this produces a list with some style names, # without checking exact content (not needed, and may vary diff --git a/tests/ttk/vsapi.test b/tests/ttk/vsapi.test index 076a815..02f6309 100644 --- a/tests/ttk/vsapi.test +++ b/tests/ttk/vsapi.test @@ -11,7 +11,7 @@ testConstraint xpnative \ test vsapi-1.1 "WINDOW WP_SMALLCLOSEBUTTON" -constraints {xpnative} -body { ttk::style element create smallclose vsapi \ - WINDOW 19 {disabled 4 pressed 3 active 2 {} 1} + WINDOW 19 {disabled 4 pressed 3 active 2 {} 1} ttk::style layout CloseButton {CloseButton.smallclose -sticky news} ttk::button .b -style CloseButton pack .b -expand true -fill both @@ -20,14 +20,14 @@ test vsapi-1.1 "WINDOW WP_SMALLCLOSEBUTTON" -constraints {xpnative} -body { test vsapi-1.2 "EXPLORERBAR EBP_HEADERPIN" -constraints {xpnative} -body { ttk::style element create pin vsapi \ - EXPLORERBAR 3 { - {pressed !selected} 3 - {active !selected} 2 - {pressed selected} 6 - {active selected} 5 - {selected} 4 - {} 1 - } + EXPLORERBAR 3 { + {pressed !selected} 3 + {active !selected} 2 + {pressed selected} 6 + {active selected} 5 + {selected} 4 + {} 1 + } ttk::style layout Explorer.Pin {Explorer.Pin.pin -sticky news} ttk::checkbutton .pin -style Explorer.Pin pack .pin -expand true -fill both @@ -36,9 +36,9 @@ test vsapi-1.2 "EXPLORERBAR EBP_HEADERPIN" -constraints {xpnative} -body { test vsapi-1.3 "EXPLORERBAR EBP_HEADERCLOSE" -constraints {xpnative} -body { ttk::style element create headerclose vsapi \ - EXPLORERBAR 2 {pressed 3 active 2 {} 1} + EXPLORERBAR 2 {pressed 3 active 2 {} 1} ttk::style layout Explorer.CloseButton { - Explorer.CloseButton.headerclose -sticky news + Explorer.CloseButton.headerclose -sticky news } ttk::button .b -style Explorer.CloseButton pack .b -expand true -fill both diff --git a/tests/unixButton.test b/tests/unixButton.test index 1b1ff04..f77ec73 100644 --- a/tests/unixButton.test +++ b/tests/unixButton.test @@ -59,16 +59,16 @@ test unixbutton-1.1 {TkpComputeButtonGeometry procedure} -constraints { pack .b1 .b2 .b3 .b4 update list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows image delete image1 } -result [list 68 48 \ - 74 54 \ - [expr {72 + $bigIndicator}] 52 \ - [expr {72 + $bigIndicator}] 52] + 74 54 \ + [expr {72 + $bigIndicator}] 52 \ + [expr {72 + $bigIndicator}] 52] test unixbutton-1.2 {TkpComputeButtonGeometry procedure} -constraints { unix } -setup { @@ -81,15 +81,15 @@ test unixbutton-1.2 {TkpComputeButtonGeometry procedure} -constraints { pack .b1 .b2 .b3 .b4 update list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows } -result [list 23 33 \ - 29 39 \ - [expr {27 + $smallIndicator}] 37 \ - [expr {27 + $smallIndicator}] 37] + 29 39 \ + [expr {27 + $smallIndicator}] 37 \ + [expr {27 + $smallIndicator}] 37] test unixbutton-1.3 {TkpComputeButtonGeometry procedure} -constraints { unix } -setup { @@ -98,15 +98,15 @@ test unixbutton-1.3 {TkpComputeButtonGeometry procedure} -constraints { label .b1 -bitmap question -bd 3 -highlightthickness 4 button .b2 -bitmap question -bd 3 -highlightthickness 0 checkbutton .b3 -bitmap question -bd 3 -highlightthickness 1 \ - -indicatoron 0 + -indicatoron 0 radiobutton .b4 -bitmap question -bd 3 -highlightthickness 1 \ -indicatoron false pack .b1 .b2 .b3 .b4 update list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows } -result {31 41 25 35 25 35 25 35} @@ -122,9 +122,9 @@ test unixbutton-1.4 {TkpComputeButtonGeometry procedure} -constraints { pack .b1 .b2 .b3 .b4 update list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows } -result {82 29 88 35 114 31 121 29} @@ -164,9 +164,9 @@ test unixbutton-1.7 {TkpComputeButtonGeometry procedure} -constraints { pack .b1 .b2 .b3 .b4 update list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows } -result {74 22 60 84 168 38 61 22} @@ -185,9 +185,9 @@ test unixbutton-1.8 {TkpComputeButtonGeometry procedure} -constraints { pack .b1 .b2 .b3 .b4 update list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows } -result {62 30 56 24 58 22 62 22} @@ -233,24 +233,24 @@ test unixbutton-2.1 {disabled coloring check, bug 669595} -constraints { set on 1 set off 0 label .l -text "The following widgets should\ - \nshow significant visible diffs\ - \nfor selected vs unselected." + \nshow significant visible diffs\ + \nfor selected vs unselected." checkbutton .cb0 -anchor w -state disabled \ - -text Unselected -variable off + -text Unselected -variable off checkbutton .cb1 -anchor w -state disabled \ - -text Selected -variable on + -text Selected -variable on checkbutton .cb2 -anchor w -state disabled \ - -text Unselected -variable off -disabledforeground "" + -text Unselected -variable off -disabledforeground "" checkbutton .cb3 -anchor w -state disabled \ - -text Selected -variable on -disabledforeground "" + -text Selected -variable on -disabledforeground "" radiobutton .rb0 -anchor w -state disabled \ - -text Unselected -variable off + -text Unselected -variable off radiobutton .rb1 -anchor w -state disabled \ - -text Selected -variable on -value 1 + -text Selected -variable on -value 1 radiobutton .rb2 -anchor w -state disabled \ - -text Unselected -variable off -disabledforeground "" + -text Unselected -variable off -disabledforeground "" radiobutton .rb3 -anchor w -state disabled \ - -text Selected -variable on -value 1 -disabledforeground "" + -text Selected -variable on -value 1 -disabledforeground "" pack .l .cb0 .cb1 .cb2 .cb3 .rb0 .rb1 .rb2 .rb3 -side top -fill x after 400 set on diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index e67278d..007c2fe 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -162,9 +162,9 @@ test unixEmbed-1.5a {Tk_UseWindow procedure, creating Container records} -constr pack .f1 .f2 child alias w winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t -use [w] - list [testembed] [expr {[lindex [lindex [testembed all] 0] 0] - [w]}] + destroy {*}[winfo children .] + toplevel .t -use [w] + list [testembed] [expr {[lindex [lindex [testembed all] 0] 0] - [w]}] } } -cleanup { interp delete child @@ -203,10 +203,10 @@ test unixEmbed-1.6a {Tk_UseWindow procedure, creating Container records} -constr child alias w1 winfo id .f1 child alias w2 winfo id .f2 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - toplevel .t2 -use [w2] - testembed + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + toplevel .t2 -use [w2] + testembed } } -cleanup { interp delete child @@ -264,14 +264,14 @@ test unixEmbed-2.1a {EmbeddedEventProc procedure} -constraints { pack .f1 child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - testembed + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + testembed } destroy .f1 update child eval { - testembed + testembed } } -cleanup { deleteWindows @@ -306,11 +306,11 @@ test unixEmbed-2.2a {EmbeddedEventProc procedure} -constraints { pack .f1 child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - testembed - destroy .t1 - testembed + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + testembed + destroy .t1 + testembed } } -cleanup { interp delete child @@ -373,9 +373,9 @@ test unixEmbed-3.1a {ContainerEventProc procedure, detect creation} -constraints child alias w1 winfo id .f1 set x [testembed] child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - wm withdraw .t1 + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + wm withdraw .t1 } list $x [testembed] } -cleanup { @@ -412,7 +412,7 @@ test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} -co } update dobg { - wm geometry .t1 + wm geometry .t1 } } -cleanup { deleteWindows @@ -429,12 +429,12 @@ test unixEmbed-3.3a {ContainerEventProc procedure, disallow position changes} -c pack .f1 child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] -bd 2 -relief raised - update - wm geometry .t1 +30+40 - update - wm geometry .t1 + destroy {*}[winfo children .] + toplevel .t1 -use [w1] -bd 2 -relief raised + update + wm geometry .t1 +30+40 + update + wm geometry .t1 } } -cleanup { interp delete child @@ -456,7 +456,7 @@ test unixEmbed-3.4 {ContainerEventProc procedure, disallow position changes} -co } update dobg { - wm geometry .t1 + wm geometry .t1 } } -cleanup { deleteWindows @@ -473,12 +473,12 @@ test unixEmbed-3.4a {ContainerEventProc procedure, disallow position changes} -c pack .f1 child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - update - wm geometry .t1 300x100+30+40 - update - wm geometry .t1 + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + update + wm geometry .t1 300x100+30+40 + update + wm geometry .t1 } } -cleanup { interp delete child @@ -517,10 +517,10 @@ test unixEmbed-3.5a {ContainerEventProc procedure, geometry requests} -constrain pack .f1 child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - .t1 configure -width 300 -height 80 - update + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + .t1 configure -width 300 -height 80 + update } list [winfo width .f1] [winfo height .f1] [child eval {wm geometry .t1}] } -cleanup { @@ -562,14 +562,14 @@ test unixEmbed-3.6a {ContainerEventProc procedure, map requests} -constraints { pack .f1 child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - set x unmapped - bind .t1 <Map> {set x mapped} - update - after 100 - update - set x + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + set x unmapped + bind .t1 <Map> {set x mapped} + update + after 100 + update + set x } } -cleanup { interp delete child @@ -612,10 +612,10 @@ test unixEmbed-3.7a {ContainerEventProc procedure, destroy events} -constraints bind .f1 <Destroy> {set x dead} set x alive child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - update - destroy .t1 + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + update + destroy .t1 } update list $x [winfo exists .f1] @@ -659,12 +659,12 @@ test unixEmbed-4.1a {EmbedStructureProc procedure, configure events} -constraint pack .f1 child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - update - .t1 configure -width 180 -height 100 - update - winfo geometry .t1 + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + update + .t1 configure -width 180 -height 100 + update + winfo geometry .t1 } } -cleanup { interp delete child @@ -703,8 +703,8 @@ test unixEmbed-4.2a {EmbedStructureProc procedure, destroy events} -constraints update child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] + destroy {*}[winfo children .] + toplevel .t1 -use [w1] } set x [testembed] destroy .f1 @@ -750,12 +750,12 @@ test unixEmbed-5.1a {EmbedFocusProc procedure, FocusIn events} -constraints { update child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - bind .t1 <FocusIn> {lappend x "focus in %W"} - bind .t1 <FocusOut> {lappend x "focus out %W"} - update - set x {} + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + bind .t1 <FocusIn> {lappend x "focus in %W"} + bind .t1 <FocusOut> {lappend x "focus out %W"} + update + set x {} } focus -force .f1 update @@ -800,10 +800,10 @@ test unixEmbed-5.2a {EmbedFocusProc procedure, focusing on dead window} -constra update child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - update - after 200 {destroy .t1} + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + update + after 200 {destroy .t1} } after 400 focus -force .f1 @@ -850,12 +850,12 @@ test unixEmbed-5.3a {EmbedFocusProc procedure, FocusOut events} -constraints { update child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - set x {} - bind .t1 <FocusIn> {lappend x "focus in %W"} - bind .t1 <FocusOut> {lappend x "focus out %W"} - update + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + set x {} + bind .t1 <FocusIn> {lappend x "focus in %W"} + bind .t1 <FocusOut> {lappend x "focus out %W"} + update } focus -force .f1 update @@ -902,14 +902,14 @@ test unixEmbed-6.1a {EmbedGeometryRequest procedure, window changes size} -const pack .f1 child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - update - bind .t1 <Configure> {set x {configure .t1 %w %h}} - set x {} - .t1 configure -width 300 -height 120 - update - list $x [winfo geom .t1] + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + update + bind .t1 <Configure> {set x {configure .t1 %w %h}} + set x {} + .t1 configure -width 300 -height 120 + update + list $x [winfo geom .t1] } } -cleanup { interp delete child @@ -949,14 +949,14 @@ test unixEmbed-6.2a {EmbedGeometryRequest procedure, window changes size} -const update child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] - update - bind .t1 <Configure> {set x {configure .t1 %w %h}} + destroy {*}[winfo children .] + toplevel .t1 -use [w1] + update + bind .t1 <Configure> {set x {configure .t1 %w %h}} set x {} - .t1 configure -width 300 -height 120 - update - list $x [winfo geom .t1] + .t1 configure -width 300 -height 120 + update + list $x [winfo geom .t1] } } -cleanup { interp delete child @@ -1009,18 +1009,18 @@ test unixEmbed-7.1a {TkpRedirectKeyEvent procedure, forward keystroke} -constrai pack .f1 child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] + destroy {*}[winfo children .] + toplevel .t1 -use [w1] } focus -force . bind . <Key> {lappend x {key %A %E}} set x {} set y [child eval { - update - bind .t1 <Key> {lappend y {key %A}} - set y {} - event generate .t1 <Key> -keysym a - set y + update + bind .t1 <Key> {lappend y {key %A}} + set y {} + event generate .t1 <Key> -keysym a + set y }] update list $x $y @@ -1071,8 +1071,8 @@ test unixEmbed-7.2a {TkpRedirectKeyEvent procedure, don't forward keystroke widt pack .f1 child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] + destroy {*}[winfo children .] + toplevel .t1 -use [w1] } update focus -force .f1 @@ -1080,11 +1080,11 @@ test unixEmbed-7.2a {TkpRedirectKeyEvent procedure, don't forward keystroke widt bind . <Key> {lappend x {key %A}} set x {} set y [child eval { - update - bind .t1 <Key> {lappend y {key %A}} - set y {} - event generate .t1 <Key> -keysym b - set y + update + bind .t1 <Key> {lappend y {key %A}} + set y {} + event generate .t1 <Key> -keysym b + set y }] update list $x $y @@ -1132,17 +1132,17 @@ test unixEmbed-8.1a {TkpClaimFocus procedure} -constraints unix -setup { update child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] -highlightthickness 2 -bd 2 -relief sunken + destroy {*}[winfo children .] + toplevel .t1 -use [w1] -highlightthickness 2 -bd 2 -relief sunken } # This should clear focus from the application embedded in .f1 focus -force .f2 update list [child eval { - set x [list [focus]] - focus .t1 + set x [list [focus]] + focus .t1 update - lappend x [focus] + lappend x [focus] }] [focus] } -cleanup { interp delete child @@ -1228,12 +1228,12 @@ test unixEmbed-9.2a {EmbedWindowDeleted procedure, check embeddedPtr} -constrain pack .f1 child alias w1 winfo id .f1 child eval { - destroy {*}[winfo children .] - toplevel .t1 -use [w1] -highlightthickness 2 -bd 2 -relief sunken - set x {} - lappend x [testembed] - destroy .t1 - lappend x [testembed] + destroy {*}[winfo children .] + toplevel .t1 -use [w1] -highlightthickness 2 -bd 2 -relief sunken + set x {} + lappend x [testembed] + destroy .t1 + lappend x [testembed] } } -cleanup { interp delete child diff --git a/tests/unixFont.test b/tests/unixFont.test index efc2fe9..08757cd 100644 --- a/tests/unixFont.test +++ b/tests/unixFont.test @@ -71,7 +71,7 @@ proc getsize {} { test unixfont-1.1 {TkpGetNativeFont procedure: not native} {x11 noExceed} { list [catch {font measure {} xyz} msg] $msg -} {1 {font "" doesn't exist}} +} {1 {font "" does not exist}} test unixfont-1.2 {TkpGetNativeFont procedure: native} {x11 failsOnUbuntu} { font measure fixed 0 } 6 @@ -88,14 +88,14 @@ test unixfont-2.2 {TkpGetFontFromAttributes procedure: Times relatives} \ lappend x [lindex [font actual {-family "Times"}] 1] } {times times times} test unixfont-2.3 {TkpGetFontFromAttributes procedure: Courier relatives} \ - {x11 noExceed hasCourierNew failsOnUbuntu} { + {x11 noExceed hasCourierNew failsOnUbuntu failsOnXQuarz} { set x {} lappend x [lindex [font actual {-family "Courier New"}] 1] lappend x [lindex [font actual {-family "Monaco"}] 1] lappend x [lindex [font actual {-family "Courier"}] 1] } {courier courier courier} test unixfont-2.4 {TkpGetFontFromAttributes procedure: Helvetica relatives} \ - {x11 noExceed hasArial failsOnUbuntu} { + {x11 noExceed hasArial failsOnUbuntu failsOnXQuarz} { set x {} lappend x [lindex [font actual {-family "Arial"}] 1] lappend x [lindex [font actual {-family "Geneva"}] 1] diff --git a/tests/unixSelect.test b/tests/unixSelect.test index cb1908b..9fb40c9 100644 --- a/tests/unixSelect.test +++ b/tests/unixSelect.test @@ -14,6 +14,8 @@ namespace import ::tcltest::* tcltest::configure {*}$argv tcltest::loadTestedCommands +testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] + global longValue selValue selInfo set selValue {} @@ -33,11 +35,11 @@ proc errIncrHandler {type offset count} { global selValue selInfo pass if {$offset == 4000} { if {$pass == 0} { - # Just sizing the selection; don't do anything here. - set pass 1 + # Just sizing the selection; don't do anything here. + set pass 1 } else { - # Fetching the selection; wait long enough to cause a timeout. - after 6000 + # Fetching the selection; wait long enough to cause a timeout. + after 6000 } } lappend selInfo $type $offset $count @@ -66,9 +68,9 @@ proc reallyBadHandler {path type offset count} { global selValue selInfo pass if {$offset == 4000} { if {$pass == 0} { - set pass 1 + set pass 1 } else { - selection handle -type $type $path {} + selection handle -type $type $path {} } } lappend selInfo $path $type $offset $count @@ -124,15 +126,15 @@ test unixSelect-1.1 {TkSelGetSelection procedure: simple i18n text} -constraints } -result 4 test unixSelect-1.2 {TkSelGetSelection procedure: simple i18n text, iso8859-1} -constraints { - x11 + x11 failsOnXQuarz } -setup { setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 üф - .e selection range 0 end + pack [entry .e] + update + .e insert 0 üф + .e selection range 0 end } selection get } -cleanup { @@ -146,13 +148,13 @@ test unixSelect-1.3 {TkSelGetSelection procedure: simple i18n text, iso2022} -co setup } -body { selection handle -type COMPOUND_TEXT -format COMPOUND_TEXT . \ - {handler COMPOUND_TEXT} + {handler COMPOUND_TEXT} selection own . set selValue üф set selInfo {} set result [dobg { - set x [selection get -type COMPOUND_TEXT] - list [string equal üф $x] [string length $x] + set x [selection get -type COMPOUND_TEXT] + list [string equal üф $x] [string length $x] }] lappend result $selInfo } -cleanup { @@ -170,15 +172,15 @@ test unixSelect-1.4 {TkSelGetSelection procedure: INCR i18n text, iso2022} -cons # The first time through, we don't convert the data to ISO2022, so the # buffer boundaries end up being different in the two passes. selection handle -type COMPOUND_TEXT -format COMPOUND_TEXT . \ - {handler COMPOUND_TEXT} + {handler COMPOUND_TEXT} selection own . set selValue [string repeat x 3999]üф[string repeat x 3999] set selInfo {} set result [dobg { - set x [selection get -type COMPOUND_TEXT] - list [string equal \ - [string repeat x 3999]üф[string repeat x 3999] $x] \ - [string length $x] + set x [selection get -type COMPOUND_TEXT] + list [string equal \ + [string repeat x 3999]üф[string repeat x 3999] $x] \ + [string length $x] }] lappend result $selInfo } -cleanup { @@ -192,13 +194,13 @@ test unixSelect-1.5 {TkSelGetSelection procedure: simple i18n text, iso2022} -co setup } -body { selection handle -type COMPOUND_TEXT -format COMPOUND_TEXT . \ - {handler COMPOUND_TEXT} + {handler COMPOUND_TEXT} selection own . set selValue üф set selInfo {} set result [dobg { - set x [selection get -type COMPOUND_TEXT] - list [string equal üф $x] [string length $x] + set x [selection get -type COMPOUND_TEXT] + list [string equal üф $x] [string length $x] }] lappend result $selInfo } -cleanup { @@ -224,10 +226,10 @@ test unixSelect-1.7 {TkSelGetSelection procedure: INCR i18n text} -constraints { setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 [string repeat x 3999]ü - .e selection range 0 end + pack [entry .e] + update + .e insert 0 [string repeat x 3999]ü + .e selection range 0 end } selection get } -cleanup { @@ -240,10 +242,10 @@ test unixSelect-1.8 {TkSelGetSelection procedure: INCR i18n text} -constraints { setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 ü[string repeat x 3999] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 ü[string repeat x 3999] + .e selection range 0 end } selection get } -cleanup { @@ -256,10 +258,10 @@ test unixSelect-1.9 {TkSelGetSelection procedure: INCR i18n text} -constraints { setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 [string repeat x 3999]ü[string repeat x 4000] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 [string repeat x 3999]ü[string repeat x 4000] + .e selection range 0 end } selection get } -cleanup { @@ -275,10 +277,10 @@ test unixSelect-1.10 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 [string repeat x 3999]ü - .e selection range 0 end + pack [entry .e] + update + .e insert 0 [string repeat x 3999]ü + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -291,10 +293,10 @@ test unixSelect-1.11 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 ü[string repeat x 3999] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 ü[string repeat x 3999] + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -307,10 +309,10 @@ test unixSelect-1.12 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 [string repeat x 3999]ü[string repeat x 4000] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 [string repeat x 3999]ü[string repeat x 4000] + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -318,7 +320,7 @@ test unixSelect-1.12 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const } -result [string repeat x 3999]ü[string repeat x 4000] test unixSelect-1.13 {TkSelGetSelection procedure: simple i18n text, utf-8} -constraints { - x11 + x11 failsOnXQuarz } -setup { destroy .e setupbg @@ -334,15 +336,15 @@ test unixSelect-1.13 {TkSelGetSelection procedure: simple i18n text, utf-8} -con } -result 5 test unixSelect-1.14 {TkSelGetSelection procedure: simple i18n text, utf-8} -constraints { - x11 + x11 failsOnXQuarz } -setup { setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 üф - .e selection range 0 end + pack [entry .e] + update + .e insert 0 üф + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -355,10 +357,10 @@ test unixSelect-1.15 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 [string repeat [string repeat Ää 50]\n 21] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 [string repeat [string repeat Ää 50]\n 21] + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -371,10 +373,10 @@ test unixSelect-1.16 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [entry .e] - update - .e insert 0 i[string repeat [string repeat Ää 50]\n 21] - .e selection range 0 end + pack [entry .e] + update + .e insert 0 i[string repeat [string repeat Ää 50]\n 21] + .e selection range 0 end } selection get -type UTF8_STRING } -cleanup { @@ -387,11 +389,11 @@ test unixSelect-1.17 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [text .t] - update - .t insert 1.0 [string repeat [string repeat Ää 50]\n 21] - # Has to be selected in a separate stage - .t tag add sel 1.0 21.end+1c + pack [text .t] + update + .t insert 1.0 [string repeat [string repeat Ää 50]\n 21] + # Has to be selected in a separate stage + .t tag add sel 1.0 21.end+1c } after 10 selection get -type UTF8_STRING @@ -405,11 +407,11 @@ test unixSelect-1.18 {TkSelGetSelection procedure: INCR i18n text, utf-8} -const setupbg } -body { dobg { - pack [text .t] - update - .t insert 1.0 i[string repeat [string repeat Ää 50]\n 21] - # Has to be selected in a separate stage - .t tag add sel 1.0 21.end+1c + pack [text .t] + update + .t insert 1.0 i[string repeat [string repeat Ää 50]\n 21] + # Has to be selected in a separate stage + .t tag add sel 1.0 21.end+1c } after 10 selection get -type UTF8_STRING diff --git a/tests/unixWm.test b/tests/unixWm.test index 2ad40e2..14d6359 100644 --- a/tests/unixWm.test +++ b/tests/unixWm.test @@ -16,18 +16,6 @@ namespace import -force ::tk::test:loadTkCommand testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}] testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] -# Starting with macOS Ventura it became necessary to wait for windows to be restacked -# or to be raised after creation. - -if {[tk windowingsystem] eq "aqua"} { - proc restackDelay {} { - after 200; - update idletasks - } -} else { - proc restackDelay {} {} -} - proc sleep ms { global x after $ms {set x 1} @@ -105,6 +93,7 @@ foreach geom "+20+80 +80+$Y0 +0+$Y0 -0-0 +0-0 -0+$Y0 -10-5 -10+$Y5 +10-5" { set i 1 foreach geom "+20+80 +80+$Y0 +0+$Y0 -0-0 +0-0 -0+$Y0 -10-5 -10+$Y5 +10-5" { test unixWm-3.$i {moving window while iconified} unix { + update wm iconify .t update idletasks wm geom .t $geom @@ -1023,7 +1012,7 @@ wm geom .t +0+0 update test unixWm-28.1 {Tk_WmCmd procedure, "maxsize" option, setting the - maxsize should update WM_NORMAL_HINTS} {testwrapper} { + maxsize should update WM_NORMAL_HINTS} {testwrapper} { destroy .t toplevel .t wm maxsize .t 300 300 @@ -1033,8 +1022,8 @@ test unixWm-28.1 {Tk_WmCmd procedure, "maxsize" option, setting the } {300 300} test unixWm-28.2 {Tk_WmCmd procedure, "maxsize" option, setting the - maxsize to a value smaller than the current size should - set the maxsize in WM_NORMAL_HINTS} {testwrapper} { + maxsize to a value smaller than the current size should + set the maxsize in WM_NORMAL_HINTS} {testwrapper} { destroy .t toplevel .t wm geom .t 400x400 @@ -1045,9 +1034,9 @@ test unixWm-28.2 {Tk_WmCmd procedure, "maxsize" option, setting the } {300 300} test unixWm-28.3 {Tk_WmCmd procedure, "maxsize" option, setting the - maxsize to a value smaller than the current size should - set the maxsize in WM_NORMAL_HINTS even if the - interactive resizable flag is set to 0} {testwrapper} { + maxsize to a value smaller than the current size should + set the maxsize in WM_NORMAL_HINTS even if the + interactive resizable flag is set to 0} {testwrapper} { destroy .t toplevel .t wm geom .t 400x400 @@ -1059,7 +1048,7 @@ test unixWm-28.3 {Tk_WmCmd procedure, "maxsize" option, setting the } {300 300} test unixWm-29.1 {Tk_WmCmd procedure, "minsize" option, setting the - minsize should update WM_NORMAL_HINTS} {testwrapper} { + minsize should update WM_NORMAL_HINTS} {testwrapper} { destroy .t toplevel .t wm minsize .t 300 300 @@ -1069,8 +1058,8 @@ test unixWm-29.1 {Tk_WmCmd procedure, "minsize" option, setting the } {300 300} test unixWm-29.2 {Tk_WmCmd procedure, "minsize" option, setting the - minsize to a value larger than the current size should - set the maxsize in WM_NORMAL_HINTS} {testwrapper} { + minsize to a value larger than the current size should + set the maxsize in WM_NORMAL_HINTS} {testwrapper} { destroy .t toplevel .t wm geom .t 200x200 @@ -1081,9 +1070,9 @@ test unixWm-29.2 {Tk_WmCmd procedure, "minsize" option, setting the } {300 300} test unixWm-29.3 {Tk_WmCmd procedure, "minsize" option, setting the - minsize to a value larger than the current size should - set the minsize in WM_NORMAL_HINTS even if the - interactive resizable flag is set to 0} {testwrapper} { + minsize to a value larger than the current size should + set the minsize in WM_NORMAL_HINTS even if the + interactive resizable flag is set to 0} {testwrapper} { destroy .t toplevel .t wm geom .t 200x200 @@ -1373,7 +1362,9 @@ test unixWm-40.1 {Tk_SetGrid procedure, set grid dimensions before turning on gr wm geometry .t } {30x10+0+0} test unixWm-40.2 {Tk_SetGrid procedure, turning on grid when dimensions already set} unix { + update destroy .t + update toplevel .t wm geometry .t 200x100+100+$Y0 listbox .t.l -height 20 -width 20 @@ -1798,6 +1789,8 @@ test unixWm-49.2 {Tk_GetRootCoords procedure, menubars} {unix testmenubar} { } {52 7 12 62} deleteWindows +# Make sure that the root window is out of the way! +wm geom . +700+700 wm withdraw . if {[tk windowingsystem] eq "aqua"} { # Modern mac windows have no border. @@ -1834,14 +1827,12 @@ test unixWm-50.2 {Tk_CoordsToWindow procedure, finding a toplevel, y-coords and tkwait visibility .t wm geom .t +100+100 update - restackDelay toplevel .t2 -width 200 -height 100 -bg blue wm overrideredirect .t2 1 tkwait visibility .t2 wm geom .t2 +200+200 update raise .t2 - restackDelay set x [winfo rootx .t] set y [winfo rooty .t] set y2 [winfo rooty .t2] @@ -1855,11 +1846,10 @@ test unixWm-50.2 {Tk_CoordsToWindow procedure, finding a toplevel, y-coords and [winfo containing [expr $x +200] [expr $y + 450]] } {{} {} .t .t .t2 .t2 .t {}} test unixWm-50.3 { - Tk_CoordsToWindow procedure, finding a toplevel with embedding + Tk_CoordsToWindow procedure, finding a toplevel with embedding } tempNotWin { deleteWindows catch {interp delete child} - toplevel .t -width 300 -height 400 -bg blue wm geom .t +100+100 frame .t.f -container 1 -bg red @@ -1871,11 +1861,11 @@ test unixWm-50.3 { child alias frameid winfo id .t.f child eval { wm withdraw . - toplevel .x -width 100 -height 80 -use [frameid] -bg yellow - tkwait visibility .x - update - set x [winfo rootx .x] - set y [winfo rooty .x] + toplevel .x -width 100 -height 80 -use [frameid] -bg yellow + tkwait visibility .x + update + set x [winfo rootx .x] + set y [winfo rooty .x] } set result [list [child eval {winfo containing [expr $x - 1] [expr $y + 50]}] \ [child eval {winfo containing $x [expr $y + 50]}]] @@ -1888,7 +1878,6 @@ test unixWm-50.3 { } {{} .x .t .t.f} test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} unix { destroy .t - catch {interp delete child} toplevel .t -width 200 -height 200 -bg green tkwait visibility .t @@ -1897,9 +1886,8 @@ test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} unix interp create child load {} Tk child child eval {wm geometry . 200x200+100+100; update} - restackDelay set result [list [winfo containing 200 200] \ - [child eval {winfo containing 200 200}]] + [child eval {winfo containing 200 200}]] interp delete child set result } {{} .} @@ -1979,21 +1967,22 @@ test unixWm-50.8 {Tk_CoordsToWindow procedure, more basics} unix { test unixWm-50.9 {Tk_CoordsToWindow procedure, unmapped windows} {unix failsOnUbuntu failsOnXQuarz} { destroy .t destroy .t2 + update toplevel .t -width 200 -height 200 -bg green tkwait visibility .t - update - wm geometry .t +0+0 + wm geometry .t +20+20 + after 200 update toplevel .t2 -width 200 -height 200 -bg red tkwait visibility .t2 + wm geometry .t2 +20+20 + after 200 update - wm geometry .t2 +0+0 - update - restackDelay - set result [list [winfo containing 100 100]] - wm iconify .t2 + set result [list [winfo containing 120 120]] + destroy .t2 + after 200 update - lappend result [winfo containing 100 100] + lappend result [winfo containing 120 120] } {.t2 .t} test unixWm-50.10 {Tk_CoordsToWindow procedure, unmapped windows} unix { destroy .t @@ -2071,7 +2060,6 @@ test unixWm-51.6 {TkWmRestackToplevel procedure, window to be stacked isn't mapp tkwait visibility .t wm geometry .t +0+0 update - restackDelay destroy .t2 toplevel .t2 -width 200 -height 200 -bg red # This test assumes that .t2 is not mapped yet, but that is not really guaranteed. @@ -2083,15 +2071,15 @@ test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} {uni toplevel $w -width 200 -height 200 -bg green tkwait visibility $w wm geometry $w +100+100 + after 200 update } + update raise .t .t2 - restackDelay update set result [list [winfo containing 200 200]] lower .t3 - restackDelay - sleep 10 + update lappend result [winfo containing 200 200] } {.t3 .t} test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix { @@ -2105,7 +2093,6 @@ test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix wm overrideredirect .t2 1 wm geometry .t2 +0+0 tkwait visibility .t2 - restackDelay # Need to use vrootx and vrooty to make tests work correctly with # virtual root window measures managers: overrideredirect windows @@ -2116,15 +2103,14 @@ test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix set y [expr 100-[winfo vrooty .]] set result [list [winfo containing $x $y]] raise .t - restackDelay lappend result [winfo containing $x $y] raise .t2 - restackDelay lappend result [winfo containing $x $y] } {.t2 .t .t2} # The mac won't put an overrideredirect window above the root, if {[tk windowingsystem] eq "aqua"} { wm withdraw . + update } test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect} unix { foreach w {.t .t2 .t3} { @@ -2132,12 +2118,11 @@ test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect} update toplevel $w -width 200 -height 200 -bg green wm overrideredirect $w 1 - wm geometry $w +0+0 tkwait visibility $w + wm geometry $w +0+0 update } lower .t3 .t2 - restackDelay update # Need to use vrootx and vrooty to make tests work correctly with @@ -2149,11 +2134,12 @@ test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect} set y [expr 100-[winfo vrooty .]] set result [list [winfo containing $x $y]] lower .t2 - restackDelay + update lappend result [winfo containing $x $y] } {.t2 .t3} if {[tk windowingsystem] eq "aqua"} { wm deiconify . + update } test unixWm-51.10 {TkWmRestackToplevel procedure, don't move window that's already in the right place} unix { makeToplevels diff --git a/tests/visual.test b/tests/visual.test index da6c41a..c4e26d2 100644 --- a/tests/visual.test +++ b/tests/visual.test @@ -28,12 +28,12 @@ proc eatColors {w} { canvas $w.c -width 400 -height 200 -bd 0 pack $w.c for {set y 0} {$y < 8} {incr y} { - for {set x 0} {$x < 40} {incr x} { - set color [format #%02x%02x%02x [expr {$x*6}] [expr {$y*30}] 0] - $w.c create rectangle [expr {10*$x}] [expr {20*$y}] \ - [expr {10*$x + 10}] [expr {20*$y + 20}] -outline {} \ - -fill $color - } + for {set x 0} {$x < 40} {incr x} { + set color [format #%02x%02x%02x [expr {$x*6}] [expr {$y*30}] 0] + $w.c create rectangle [expr {10*$x}] [expr {20*$y}] \ + [expr {10*$x + 10}] [expr {20*$y + 20}] -outline {} \ + -fill $color + } } update } @@ -51,7 +51,7 @@ proc eatColors {w} { proc colorsFree {w {red 31} {green 245} {blue 192}} { set vals [winfo rgb $w [format #%02x%02x%02x $red $green $blue]] expr {([lindex $vals 0]/256 == $red) && ([lindex $vals 1]/256 == $green) - && ([lindex $vals 2]/256 == $blue)} + && ([lindex $vals 2]/256 == $blue)} } # If more than one visual type is available for the screen, pick one @@ -62,10 +62,10 @@ set avail [winfo visualsavailable .] set other {} if {[llength $avail] > 1} { foreach visual $avail { - if {$visual != $default} { - set other $visual - break - } + if {$visual != $default} { + set other $visual + break + } } } testConstraint haveOtherVisual [expr {$other ne ""}] @@ -341,7 +341,7 @@ test visual-3.1 {Tk_GetVisual, parsing visual string} -setup { deleteWindows } -body { toplevel .t1 -width 250 -height 100 \ - -visual "[winfo visual .][winfo depth .]" + -visual "[winfo visual .][winfo depth .]" wm geometry .t1 +0+0 update concat "[winfo visual .t1] [winfo depth .t1]" @@ -529,8 +529,8 @@ test visual-8.1 {Tk_FreeColormap procedure} -setup { toplevel .t1 -width 300 -height 180 -colormap new wm geometry .t1 +0+0 foreach i {.t2 .t3 .t4} { - toplevel $i -width 250 -height 150 -colormap .t1 - wm geometry $i +0+0 + toplevel $i -width 250 -height 150 -colormap .t1 + wm geometry $i +0+0 } destroy .t1 destroy .t3 @@ -545,8 +545,8 @@ test visual-8.2 {Tk_FreeColormap procedure} -constraints haveOtherVisual -setup toplevel .t1 -width 300 -height 180 -visual $other wm geometry .t1 +0+0 foreach i {.t2 .t3 .t4} { - toplevel $i -width 250 -height 150 -visual $other - wm geometry $i +0+0 + toplevel $i -width 250 -height 150 -visual $other + wm geometry $i +0+0 } destroy .t2 destroy .t3 diff --git a/tests/visual_bb.test b/tests/visual_bb.test index c2bed6f..e118838 100644 --- a/tests/visual_bb.test +++ b/tests/visual_bb.test @@ -51,7 +51,7 @@ test 1.1 {running visual tests} -constraints userInteraction -body { frame .menu -relief raised -borderwidth 1 message .msg -font {Times 18} -relief raised -width 4i \ - -borderwidth 1 -text "This application provides a collection of visual tests for the Tk toolkit. Each menu entry invokes a test, which displays information on the screen. You can then verify visually that the information is being displayed in the correct way. The tests under the \"Postscript\" menu exercise the Postscript-generation capabilities of canvas widgets." + -borderwidth 1 -text "This application provides a collection of visual tests for the Tk toolkit. Each menu entry invokes a test, which displays information on the screen. You can then verify visually that the information is being displayed in the correct way. The tests under the \"Postscript\" menu exercise the Postscript-generation capabilities of canvas widgets." pack .menu -side top -fill x pack .msg -side bottom -expand yes -fill both @@ -69,26 +69,26 @@ test 1.1 {running visual tests} -constraints userInteraction -body { menu .menu.group1.m .menu.group1.m add command -label "Canvas arcs" -command {runTest arc.tcl} .menu.group1.m add command -label "Beveled borders in text widgets" \ - -command {runTest bevel.tcl} + -command {runTest bevel.tcl} .menu.group1.m add command -label "Colormap management" \ - -command {runTest cmap.tcl} + -command {runTest cmap.tcl} .menu.group1.m add command -label "Label/button geometry" \ - -command {runTest butGeom.tcl} + -command {runTest butGeom.tcl} .menu.group1.m add command -label "Label/button colors" \ - -command {runTest butGeom2.tcl} + -command {runTest butGeom2.tcl} menubutton .menu.ps -text "Canvas Postscript" -menu .menu.ps.m menu .menu.ps.m .menu.ps.m add command -label "Rectangles and other graphics" \ - -command {runTest canvPsGrph.tcl} + -command {runTest canvPsGrph.tcl} .menu.ps.m add command -label "Text" \ - -command {runTest canvPsText.tcl} + -command {runTest canvPsText.tcl} .menu.ps.m add command -label "Bitmaps" \ - -command {runTest canvPsBmap.tcl} + -command {runTest canvPsBmap.tcl} .menu.ps.m add command -label "Images" \ - -command {runTest canvPsImg.tcl} + -command {runTest canvPsImg.tcl} .menu.ps.m add command -label "Arcs" \ - -command {runTest canvPsArc.tcl} + -command {runTest canvPsArc.tcl} pack .menu.file .menu.group1 .menu.ps -side left -padx 1m @@ -96,7 +96,7 @@ test 1.1 {running visual tests} -constraints userInteraction -body { bind . <FocusIn> { if {("%d" == "NotifyVirtual") && ("%m" == "NotifyNormal")} { - focus .menu + focus .menu } } tk_menuBar .menu .menu.file .menu.group1 .menu.ps diff --git a/tests/winButton.test b/tests/winButton.test index a19f4e7..e2107ba 100644 --- a/tests/winButton.test +++ b/tests/winButton.test @@ -33,17 +33,17 @@ test winbutton-1.1 {TkpComputeButtonGeometry procedure} -constraints { label .b1 -image image1 -bd 4 -padx 0 -pady 2 button .b2 -image image1 -bd 4 -padx 0 -pady 2 checkbutton .b3 -image image1 -bd 4 -padx 1 -pady 1 \ - -font {{MS Sans Serif} 8} + -font {{MS Sans Serif} 8} radiobutton .b4 -image image1 -bd 4 -padx 2 -pady 0 \ - -font {{MS Sans Serif} 8} + -font {{MS Sans Serif} 8} pack .b1 .b2 .b3 .b4 update # with patch 463234 with native L&F enabled, this returns: # {68 48 70 50 88 50 88 50} list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows image delete image1 @@ -59,17 +59,17 @@ test winbutton-1.2 {TkpComputeButtonGeometry procedure} -constraints { label .b1 -bitmap question -bd 3 -padx 0 -pady 2 button .b2 -bitmap question -bd 3 -padx 0 -pady 2 checkbutton .b3 -bitmap question -bd 3 -padx 1 -pady 1 \ - -font {{MS Sans Serif} 8} + -font {{MS Sans Serif} 8} radiobutton .b4 -bitmap question -bd 3 -padx 2 -pady 0 \ - -font {{MS Sans Serif} 8} + -font {{MS Sans Serif} 8} pack .b1 .b2 .b3 .b4 update # with patch 463234 with native L&F enabled, this returns: # {23 33 25 35 43 35 43 35} list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows } -result {23 33 25 35 45 37 45 37} @@ -80,16 +80,16 @@ test winbutton-1.3 {TkpComputeButtonGeometry procedure} -constraints win -setup label .b1 -bitmap question -bd 3 -highlightthickness 4 button .b2 -bitmap question -bd 3 -highlightthickness 0 checkbutton .b3 -bitmap question -bd 3 -highlightthickness 1 \ - -indicatoron 0 + -indicatoron 0 radiobutton .b4 -bitmap question -bd 3 -indicatoron false pack .b1 .b2 .b3 .b4 update # with patch 463234 with native L&F enabled, this returns: # {31 41 23 33 25 35 25 35} list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows } -result {31 41 23 33 27 37 27 37} @@ -106,9 +106,9 @@ test winbutton-1.4 {TkpComputeButtonGeometry procedure} -constraints { pack .b1 .b2 .b3 .b4 update list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows } -result {58 24 67 33 88 30 90 28} @@ -119,7 +119,7 @@ test winbutton-1.5 {TkpComputeButtonGeometry procedure} -constraints { deleteWindows } -body { label .l1 -wraplength 1.5i -padx 0 -pady 0 \ - -text "This is a long string that will wrap around on several lines.\n\nIt also has a blank line (above)." + -text "This is a long string that will wrap around on several lines.\n\nIt also has a blank line (above)." pack .l1 update list [winfo reqwidth .l1] [winfo reqheight .l1] @@ -133,7 +133,7 @@ test winbutton-1.6 {TkpComputeButtonGeometry procedure} -constraints { deleteWindows } -body { label .l1 -padx 0 -pady 0 \ - -text "This is a long string without wrapping.\n\nIt also has a blank line (above)." + -text "This is a long string without wrapping.\n\nIt also has a blank line (above)." pack .l1 update list [winfo reqwidth .l1] [winfo reqheight .l1] @@ -153,9 +153,9 @@ test winbutton-1.7 {TkpComputeButtonGeometry procedure} -constraints { pack .b1 .b2 .b3 .b4 update list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows } -result {74 24 67 97 174 46 64 28} @@ -175,9 +175,9 @@ test winbutton-1.8 {TkpComputeButtonGeometry procedure} -constraints { pack .b1 .b2 .b3 .b4 update list [winfo reqwidth .b1] [winfo reqheight .b1] \ - [winfo reqwidth .b2] [winfo reqheight .b2] \ - [winfo reqwidth .b3] [winfo reqheight .b3] \ - [winfo reqwidth .b4] [winfo reqheight .b4] + [winfo reqwidth .b2] [winfo reqheight .b2] \ + [winfo reqwidth .b3] [winfo reqheight .b3] \ + [winfo reqwidth .b4] [winfo reqheight .b4] } -cleanup { deleteWindows } -result {66 32 65 31 69 31 71 29} diff --git a/tests/winClipboard.test b/tests/winClipboard.test index 28e508b..cb286f0 100644 --- a/tests/winClipboard.test +++ b/tests/winClipboard.test @@ -59,7 +59,7 @@ test winClipboard-1.4 {TkSelGetSelection & TkWinClipboardRender} -constraints { set map [list "\r" "\\r" "\n" "\\n"] clipboard append "line 1\nline 2" list [string map $map [selection get -selection CLIPBOARD]]\ - [string map $map [testclipboard]] + [string map $map [testclipboard]] } -cleanup { clipboard clear } -result [list "line 1\\nline 2" "line 1\\nline 2"] @@ -72,7 +72,7 @@ test winClipboard-1.5 {TkSelGetSelection & TkWinClipboardRender} -constraints { set map [list "\r" "\\r" "\n" "\\n"] clipboard append "line 1Ç\nline 2" list [string map $map [selection get -selection CLIPBOARD]]\ - [string map $map [testclipboard]] + [string map $map [testclipboard]] } -cleanup { clipboard clear } -result [list "line 1Ç\\nline 2" "line 1Ç\\nline 2"] diff --git a/tests/winDialog.test b/tests/winDialog.test index 5fddf19..53a24ef 100755 --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -65,31 +65,31 @@ proc afterbody {} { # On Vista and later, using the new file dialogs we have to find # the window using its title as tk_dialog will not be set at the C level if {[vista?]} { - if {[catch {testfindwindow "" $::dialogclass} ::tk_dialog]} { - if {[incr ::iter_after] > 30} { - set ::dialogresult ">30 iterations waiting on tk_dialog" - return - } - after 150 {afterbody} - return - } + if {[catch {testfindwindow "" $::dialogclass} ::tk_dialog]} { + if {[incr ::iter_after] > 30} { + set ::dialogresult ">30 iterations waiting on tk_dialog" + return + } + after 150 {afterbody} + return + } } else { - if {$::tk_dialog == 0} { - if {[incr ::iter_after] > 30} { - set ::dialogresult ">30 iterations waiting on tk_dialog" - return - } - after 150 {afterbody} - return - } + if {$::tk_dialog == 0} { + if {[incr ::iter_after] > 30} { + set ::dialogresult ">30 iterations waiting on tk_dialog" + return + } + after 150 {afterbody} + return + } } uplevel #0 {set dialogresult [eval $command]} } proc Click {button} { switch -exact -- $button { - ok { set button 1 } - cancel { set button 2 } + ok { set button 1 } + cancel { set button 2 } } testwinevent $::tk_dialog $button WM_LBUTTONDOWN 1 0x000a000b testwinevent $::tk_dialog $button WM_LBUTTONUP 0 0x000a000b @@ -97,8 +97,8 @@ proc Click {button} { proc GetText {id} { switch -exact -- $id { - ok { set id 1 } - cancel { set id 2 } + ok { set id 1 } + cancel { set id 2 } } return [testwinevent $::tk_dialog $id WM_GETTEXT] } @@ -118,7 +118,7 @@ test winDialog-1.1 {Tk_ChooseColorObjCmd} -constraints { } -body { start {tk_chooseColor} then { - Click cancel + Click cancel } } -result 0 test winDialog-1.2 {Tk_ChooseColorObjCmd} -constraints { @@ -126,7 +126,7 @@ test winDialog-1.2 {Tk_ChooseColorObjCmd} -constraints { } -body { start {set clr [tk_chooseColor -initialcolor "#ff9933"]} then { - set x [Click cancel] + set x [Click cancel] } list $x $clr } -result {0 {}} @@ -135,7 +135,7 @@ test winDialog-1.3 {Tk_ChooseColorObjCmd} -constraints { } -body { start {set clr [tk_chooseColor -initialcolor "#ff9933"]} then { - set x [Click ok] + set x [Click ok] } list $x $clr } -result [list 0 "#ff9933"] @@ -147,11 +147,11 @@ test winDialog-1.4 {Tk_ChooseColorObjCmd: -title} -constraints { set x {} start {set clr [tk_chooseColor -initialcolor "#ff9933" -title "Hello"]} then { - if {[catch { - array set a [testgetwindowinfo $::tk_dialog] - if {[info exists a(text)]} {lappend x $a(text)} - } err]} { lappend x $err } - lappend x [Click ok] + if {[catch { + array set a [testgetwindowinfo $::tk_dialog] + if {[info exists a(text)]} {lappend x $a(text)} + } err]} { lappend x $err } + lappend x [Click ok] } lappend x $clr } -result [list Hello 0 "#ff9933"] @@ -162,15 +162,15 @@ test winDialog-1.5 {Tk_ChooseColorObjCmd: -title} -constraints { } -body { set x {} start { - set clr [tk_chooseColor -initialcolor "#ff9933" \ - -title "Привет"] + set clr [tk_chooseColor -initialcolor "#ff9933" \ + -title "Привет"] } then { - if {[catch { - array set a [testgetwindowinfo $::tk_dialog] - if {[info exists a(text)]} {lappend x $a(text)} - } err]} { lappend x $err } - lappend x [Click ok] + if {[catch { + array set a [testgetwindowinfo $::tk_dialog] + if {[info exists a(text)]} {lappend x $a(text)} + } err]} { lappend x $err } + lappend x [Click ok] } lappend x $clr } -result [list "Привет" 0 "#ff9933"] @@ -182,13 +182,13 @@ test winDialog-1.6 {Tk_ChooseColorObjCmd: -parent} -constraints { start {set clr [tk_chooseColor -initialcolor "#ff9933" -parent .]} set x {} then { - if {[catch { - array set a [testgetwindowinfo $::tk_dialog] - if {[info exists a(parent)]} { - append x [expr {$a(parent) == [wm frame .]}] - } - } err]} {lappend x $err} - Click ok + if {[catch { + array set a [testgetwindowinfo $::tk_dialog] + if {[info exists a(parent)]} { + append x [expr {$a(parent) == [wm frame .]}] + } + } err]} {lappend x $err} + Click ok } list $x $clr } -result [list 1 "#ff9933"] @@ -206,8 +206,8 @@ test winDialog-3.1 {Tk_GetOpenFileObjCmd} -constraints { } -body { start {tk_getOpenFile} then { - set x [GetText cancel] - Click cancel + set x [GetText cancel] + Click cancel } return $x } -result {Cancel} @@ -218,8 +218,8 @@ test winDialog-4.1 {Tk_GetSaveFileObjCmd} -constraints { } -body { start {tk_getSaveFile} then { - set x [GetText cancel] - Click cancel + set x [GetText cancel] + Click cancel } return $x } -result {Cancel} @@ -229,7 +229,7 @@ test winDialog-5.1 {GetFileName: no arguments} -constraints { } -body { start {tk_getOpenFile -title Open} then { - Click cancel + Click cancel } } -result 0 test winDialog-5.2 {GetFileName: one argument} -constraints { @@ -242,7 +242,7 @@ test winDialog-5.3 {GetFileName: many arguments} -constraints { } -body { start {tk_getOpenFile -initialdir [initialdir] -parent . -title test -initialfile foo} then { - Click cancel + Click cancel } } -result 0 test winDialog-5.4 {GetFileName: Tcl_GetIndexFromObj() != TCL_OK} -constraints { @@ -255,7 +255,7 @@ test winDialog-5.5 {GetFileName: Tcl_GetIndexFromObj() == TCL_OK} -constraints { } -body { start {set x [tk_getOpenFile -title bar]} set y [then { - Click cancel + Click cancel }] # Note this also tests fix for # https://core.tcl-lang.org/tk/tktview/4a0451f5291b3c9168cc560747dae9264e1d2ef6 @@ -399,11 +399,11 @@ test winDialog-5.7.7 {tk_getOpenFile: -defaultextension} -constraints { unset -nocomplain x tcltest::makeFile "" "5 7 7.aaa" [initialdir] start {set x [tk_getOpenFile \ - -defaultextension aaa \ - -initialdir [file nativename [initialdir]] \ - -initialfile "5 7 7" -title Foo]} + -defaultextension aaa \ + -initialdir [file nativename [initialdir]] \ + -initialfile "5 7 7" -title Foo]} then { - Click ok + Click ok } return $x } -result [file join [initialdir] "5 7 7.aaa"] @@ -414,11 +414,11 @@ test winDialog-5.7.8 {tk_getOpenFile: -defaultextension} -constraints { unset -nocomplain x tcltest::makeFile "" "5 7 8.aaa" [initialdir] start {set x [tk_getOpenFile \ - -defaultextension aaa \ - -initialdir [file nativename [initialdir]] \ - -initialfile "5 7 8.aaa" -title Foo]} + -defaultextension aaa \ + -initialdir [file nativename [initialdir]] \ + -initialfile "5 7 8.aaa" -title Foo]} then { - Click ok + Click ok } return $x } -result [file join [initialdir] "5 7 8.aaa"] @@ -449,16 +449,16 @@ test winDialog-5.9 {GetFileName: file types} -constraints { # types control has no control ID and we don't have a mechanism to # locate it. if {[vista?]} { - then { - Click cancel - } - return 1 + then { + Click cancel + } + return 1 } else { - then { - set x [GetText 0x470] - Click cancel - } - return [string equal $x {foo files (*.foo)}] + then { + set x [GetText 0x470] + Click cancel + } + return [string equal $x {foo files (*.foo)}] } } -result 1 test winDialog-5.10 {GetFileName: file types: MakeFilter() fails} -constraints { @@ -474,10 +474,10 @@ test winDialog-5.11 {GetFileName: initial directory} -constraints { # case FILE_INITDIR: unset -nocomplain x start {set x [tk_getSaveFile \ - -initialdir [initialdir] \ - -initialfile "12x 455" -title Foo]} + -initialdir [initialdir] \ + -initialfile "12x 455" -title Foo]} then { - Click ok + Click ok } return $x } -result [file join [initialdir] "12x 455"] @@ -493,10 +493,10 @@ test winDialog-5.12.1 {tk_getSaveFile: initial directory: ~} -constraints { } -body { unset -nocomplain x start {set x [tk_getSaveFile \ - -initialdir ~ \ - -initialfile "5 12 1" -title Foo]} + -initialdir ~ \ + -initialfile "5 12 1" -title Foo]} then { - Click ok + Click ok } return $x } -result [file normalize [file join ~ "5 12 1"]] @@ -512,10 +512,10 @@ test winDialog-5.12.2 {tk_getSaveFile: initial directory: ~user} -constraints { unset -nocomplain x start {set x [tk_getSaveFile \ - -initialdir ~$::tcl_platform(user) \ - -initialfile "5 12 2" -title Foo]} + -initialdir ~$::tcl_platform(user) \ + -initialfile "5 12 2" -title Foo]} then { - Click ok + Click ok } return $x } -result [file normalize [file join ~$::tcl_platform(user) "5 12 2"]] @@ -528,16 +528,16 @@ test winDialog-5.12.3 {tk_getSaveFile: initial directory: .} -constraints { set newdir [tcltest::makeDirectory "5 12 3"] set cur [pwd] try { - cd $newdir - unset -nocomplain x - start {set x [tk_getSaveFile \ - -initialdir . \ - -initialfile "testfile" -title Foo]} - then { - Click ok - } + cd $newdir + unset -nocomplain x + start {set x [tk_getSaveFile \ + -initialdir . \ + -initialfile "testfile" -title Foo]} + then { + Click ok + } } finally { - cd $cur + cd $cur } string equal $x [file join $newdir testfile] } -result 1 @@ -548,10 +548,10 @@ test winDialog-5.12.4 {tk_getSaveFile: initial directory: unicode} -constraints set dir [tcltest::makeDirectory "ŧéŝŧ"] unset -nocomplain x start {set x [tk_getSaveFile \ - -initialdir $dir \ - -initialfile "testfile" -title Foo]} + -initialdir $dir \ + -initialfile "testfile" -title Foo]} then { - Click ok + Click ok } string equal $x [file join $dir testfile] } -result 1 @@ -561,10 +561,10 @@ test winDialog-5.12.5 {tk_getSaveFile: initial directory: nativename} -constrain } -body { unset -nocomplain x start {set x [tk_getSaveFile \ - -initialdir [file nativename [initialdir]] \ - -initialfile "5 12 5" -title Foo]} + -initialdir [file nativename [initialdir]] \ + -initialfile "5 12 5" -title Foo]} then { - Click ok + Click ok } return $x } -result [file join [initialdir] "5 12 5"] @@ -577,16 +577,16 @@ test winDialog-5.12.6 {tk_getSaveFile: initial directory: relative} -constraints set dir [tcltest::makeDirectory "5 12 6"] set cur [pwd] try { - cd [file dirname $dir] - unset -nocomplain x - start {set x [tk_getSaveFile \ - -initialdir "5 12 6" \ - -initialfile "testfile" -title Foo]} - then { - Click ok - } + cd [file dirname $dir] + unset -nocomplain x + start {set x [tk_getSaveFile \ + -initialdir "5 12 6" \ + -initialfile "testfile" -title Foo]} + then { + Click ok + } } finally { - cd $cur + cd $cur } string equal $x [file join $dir testfile] } -result 1 @@ -608,10 +608,10 @@ test winDialog-5.12.7 {tk_getOpenFile: initial directory: ~} -setup { set fn [file tail [lindex [glob -types f ~/*] 0]] unset -nocomplain x start {set x [tk_getOpenFile \ - -initialdir ~ \ - -initialfile $fn -title Foo]} + -initialdir ~ \ + -initialfile $fn -title Foo]} then { - Click ok + Click ok } string equal $x [file normalize [file join ~ $fn]] } -cleanup { @@ -629,16 +629,16 @@ test winDialog-5.12.8 {tk_getOpenFile: initial directory: .} -constraints { set path [tcltest::makeFile "" "testfile" $newdir] set cur [pwd] try { - cd $newdir - unset -nocomplain x - start {set x [tk_getOpenFile \ - -initialdir . \ - -initialfile "testfile" -title Foo]} - then { - Click ok - } + cd $newdir + unset -nocomplain x + start {set x [tk_getOpenFile \ + -initialdir . \ + -initialfile "testfile" -title Foo]} + then { + Click ok + } } finally { - cd $cur + cd $cur } string equal $x $path } -result 1 @@ -650,10 +650,10 @@ test winDialog-5.12.9 {tk_getOpenFile: initial directory: unicode} -constraints set path [tcltest::makeFile "" testfile $dir] unset -nocomplain x start {set x [tk_getOpenFile \ - -initialdir $dir \ - -initialfile "testfile" -title Foo]} + -initialdir $dir \ + -initialfile "testfile" -title Foo]} then { - Click ok + Click ok } string equal $x $path } -result 1 @@ -664,10 +664,10 @@ test winDialog-5.12.10 {tk_getOpenFile: initial directory: nativename} -constrai unset -nocomplain x tcltest::makeFile "" "5 12 10" [initialdir] start {set x [tk_getOpenFile \ - -initialdir [file nativename [initialdir]] \ - -initialfile "5 12 10" -title Foo]} + -initialdir [file nativename [initialdir]] \ + -initialfile "5 12 10" -title Foo]} then { - Click ok + Click ok } return $x } -result [file join [initialdir] "5 12 10"] @@ -681,16 +681,16 @@ test winDialog-5.12.11 {tk_getOpenFile: initial directory: relative} -constraint set path [tcltest::makeFile "" testfile $dir] set cur [pwd] try { - cd [file dirname $dir] - unset -nocomplain x - start {set x [tk_getOpenFile \ - -initialdir [file tail $dir] \ - -initialfile "testfile" -title Foo]} - then { - Click ok - } + cd [file dirname $dir] + unset -nocomplain x + start {set x [tk_getOpenFile \ + -initialdir [file tail $dir] \ + -initialfile "testfile" -title Foo]} + then { + Click ok + } } finally { - cd $cur + cd $cur } string equal $x $path } -result 1 @@ -702,7 +702,7 @@ test winDialog-5.13 {GetFileName: initial file} -constraints { start {set x [tk_getSaveFile -initialfile "12x 456" -title Foo]} then { - Click ok + Click ok } file tail $x } -result "12x 456" @@ -716,17 +716,17 @@ if {![vista?]} { # XXX - disabled for Vista because the new dialogs allow long file # names to be specified but force the user to change it. test winDialog-5.15 {GetFileName: initial file: long name} -constraints { - nt testwinevent + nt testwinevent } -body { - start { - set dialogresult [catch { - tk_getSaveFile -initialfile [string repeat a 1024] -title Long - } x] - } - then { - Click ok - } - list $dialogresult [string match "invalid filename *" $x] + start { + set dialogresult [catch { + tk_getSaveFile -initialfile [string repeat a 1024] -title Long + } x] + } + then { + Click ok + } + list $dialogresult [string match "invalid filename *" $x] } -result {1 1} } test winDialog-5.16 {GetFileName: parent} -constraints { @@ -738,7 +738,7 @@ test winDialog-5.16 {GetFileName: parent} -constraints { set x 0 start {tk_getOpenFile -parent .t -title Parent; set x 1} then { - destroy .t + destroy .t } return $x } -result 1 @@ -749,35 +749,35 @@ test winDialog-5.17 {GetFileName: title} -constraints { start {tk_getOpenFile -title Narf} then { - Click cancel + Click cancel } } -result 0 if {[vista?]} { # In the newer file dialogs, the file type widget does not even exist # if no file types specified test winDialog-5.18 {GetFileName: no filter specified} -constraints { - nt testwinevent + nt testwinevent } -body { - # if (ofn.lpstrFilter == NULL) - start {tk_getOpenFile -title Filter} - then { - catch {set x [GetText 0x470]} y - Click cancel - } - return $y + # if (ofn.lpstrFilter == NULL) + start {tk_getOpenFile -title Filter} + then { + catch {set x [GetText 0x470]} y + Click cancel + } + return $y } -result {Could not find control with id 1136} } else { test winDialog-5.18 {GetFileName: no filter specified} -constraints { - nt testwinevent + nt testwinevent } -body { - # if (ofn.lpstrFilter == NULL) - - start {tk_getOpenFile -title Filter} - then { - set x [GetText 0x470] - Click cancel - } - return $x + # if (ofn.lpstrFilter == NULL) + + start {tk_getOpenFile -title Filter} + then { + set x [GetText 0x470] + Click cancel + } + return $x } -result {All Files (*.*)} } test winDialog-5.19 {GetFileName: parent HWND doesn't yet exist} -constraints { @@ -790,7 +790,7 @@ test winDialog-5.19 {GetFileName: parent HWND doesn't yet exist} -constraints { toplevel .t start {tk_getOpenFile -parent .t -title Open} then { - destroy .t + destroy .t } } -result {} test winDialog-5.20 {GetFileName: parent HWND already exists} -constraints { @@ -802,7 +802,7 @@ test winDialog-5.20 {GetFileName: parent HWND already exists} -constraints { update start {tk_getOpenFile -parent .t -title Open} then { - destroy .t + destroy .t } } -result {} test winDialog-5.21 {GetFileName: call GetOpenFileName} -constraints { @@ -812,8 +812,8 @@ test winDialog-5.21 {GetFileName: call GetOpenFileName} -constraints { start {tk_getOpenFile -title Open} then { - set x [GetText ok] - Click cancel + set x [GetText ok] + Click cancel } return $x } -result {&Open} @@ -824,8 +824,8 @@ test winDialog-5.22 {GetFileName: call GetSaveFileName} -constraints { start {tk_getSaveFile -title Save} then { - set x [GetText ok] - Click cancel + set x [GetText ok] + Click cancel } return $x } -result {&Save} @@ -853,7 +853,7 @@ test winDialog-5.24 {GetFileName: file types: MakeFilter() succeeds} -constraint start {set x [catch {tk_getSaveFile -filetypes {{"foo" .foo {\0\0\0\0}}}}]} then { - Click cancel + Click cancel } return $x } -result 0 @@ -864,7 +864,7 @@ test winDialog-5.25 {GetFileName: file types: MakeFilter() succeeds} -constraint start {set x [catch {tk_getSaveFile -filetypes {{"foo" .foo {••••}}}}]} then { - Click cancel + Click cancel } return $x } -result 0 @@ -888,7 +888,7 @@ test winDialog-9.1 {Tk_ChooseDirectoryObjCmd: no arguments} -constraints { } -body { start {set x [tk_chooseDirectory]} set y [then { - Click cancel + Click cancel }] # $x should be "" on a Cancel append x $y @@ -902,10 +902,10 @@ test winDialog-9.3 {Tk_ChooseDirectoryObjCmd: many arguments} -constraints { nt testwinevent } -body { start { - tk_chooseDirectory -initialdir [initialdir] -mustexist 1 -parent . -title test + tk_chooseDirectory -initialdir [initialdir] -mustexist 1 -parent . -title test } then { - Click cancel + Click cancel } } -result 0 test winDialog-9.4 {Tk_ChooseDirectoryObjCmd: Tcl_GetIndexFromObj() != TCL_OK} -constraints { @@ -918,7 +918,7 @@ test winDialog-9.5 {Tk_ChooseDirectoryObjCmd: Tcl_GetIndexFromObj() == TCL_OK} - } -body { start {tk_chooseDirectory -title bar} then { - Click cancel + Click cancel } } -result 0 test winDialog-9.6 {Tk_ChooseDirectoryObjCmd: valid option, but missing value} -constraints { @@ -933,7 +933,7 @@ test winDialog-9.7 {Tk_ChooseDirectoryObjCmd: -initialdir} -constraints { start {set x [tk_chooseDirectory -initialdir [initialdir] -title Foo]} then { - Click ok + Click ok } string tolower [set x] } -result [string tolower [initialdir]] @@ -959,8 +959,8 @@ test winDialog-10.2 {Tk_FontchooserObjCmd: -initialfont} -constraints { nt testwinevent } -body { start { - tk fontchooser configure -command ApplyFont -font system - tk fontchooser show + tk fontchooser configure -command ApplyFont -font system + tk fontchooser show } list [then { Click cancel @@ -970,8 +970,8 @@ test winDialog-10.3 {Tk_FontchooserObjCmd: -initialfont} -constraints { nt testwinevent } -body { start { - tk fontchooser configure -command ApplyFont -font system - tk fontchooser show + tk fontchooser configure -command ApplyFont -font system + tk fontchooser show } list [then { Click 1 @@ -981,8 +981,8 @@ test winDialog-10.4 {Tk_FontchooserObjCmd: -title} -constraints { nt testwinevent } -body { start { - tk fontchooser configure -command ApplyFont -title "tk test" - tk fontchooser show + tk fontchooser configure -command ApplyFont -title "tk test" + tk fontchooser show } list [then { Click cancel @@ -994,11 +994,11 @@ test winDialog-10.5 {Tk_FontchooserObjCmd: -parent} -constraints { array set a {parent {}} } -body { start { - tk fontchooser configure -command ApplyFont -parent . - tk fontchooser show + tk fontchooser configure -command ApplyFont -parent . + tk fontchooser show } then { - array set a [testgetwindowinfo $::tk_dialog] + array set a [testgetwindowinfo $::tk_dialog] Click cancel } list [expr {$a(parent) == [wm frame .]}] $::testfont @@ -1007,8 +1007,8 @@ test winDialog-10.6 {Tk_FontchooserObjCmd: -apply} -constraints { nt testwinevent } -body { start { - tk fontchooser configure -command FooBarBaz - tk fontchooser show + tk fontchooser configure -command FooBarBaz + tk fontchooser show } then { Click cancel @@ -1018,12 +1018,12 @@ test winDialog-10.7 {Tk_FontchooserObjCmd: -apply} -constraints { nt testwinevent } -body { start { - tk fontchooser configure -command ApplyFont -parent . - tk fontchooser show + tk fontchooser configure -command ApplyFont -parent . + tk fontchooser show } list [then { Click [expr {0x0402}] ;# value from XP - Click cancel + Click cancel }] [expr {[llength $::testfont] > 0}] } -result {0 1} test winDialog-10.8 {Tk_FontchooserObjCmd: -title} -constraints { @@ -1032,12 +1032,12 @@ test winDialog-10.8 {Tk_FontchooserObjCmd: -title} -constraints { array set a {text failed} } -body { start { - tk fontchooser configure -command ApplyFont -title "Hello" - tk fontchooser show + tk fontchooser configure -command ApplyFont -title "Hello" + tk fontchooser show } then { - array set a [testgetwindowinfo $::tk_dialog] - Click cancel + array set a [testgetwindowinfo $::tk_dialog] + Click cancel } set a(text) } -result "Hello" @@ -1047,13 +1047,13 @@ test winDialog-10.9 {Tk_FontchooserObjCmd: -title} -constraints { array set a {text failed} } -body { start { - tk fontchooser configure -command ApplyFont \ - -title "Привет" - tk fontchooser show + tk fontchooser configure -command ApplyFont \ + -title "Привет" + tk fontchooser show } then { - array set a [testgetwindowinfo $::tk_dialog] - Click cancel + array set a [testgetwindowinfo $::tk_dialog] + Click cancel } set a(text) } -result "Привет" diff --git a/tests/winFont.test b/tests/winFont.test index 03096f6..495a5d2 100644 --- a/tests/winFont.test +++ b/tests/winFont.test @@ -21,7 +21,7 @@ test winfont-1.1 {TkpGetNativeFont procedure: not native} -constraints { } -body { catch {font delete xyz} font measure {} xyz -} -returnCodes error -result {font "" doesn't exist} +} -returnCodes error -result {font "" does not exist} test winfont-1.2 {TkpGetNativeFont procedure: native} -constraints win -body { font measure ansifixed 0 font measure ansi 0 @@ -136,7 +136,7 @@ test winfont-5.1 {Tk_MeasureChars procedure: unbounded right margin} -constraint destroy .t.l } -body { label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \ - -text "0" -font systemfixed + -text "0" -font systemfixed pack .t.l update set ax [winfo reqwidth .t.l] @@ -144,7 +144,7 @@ test winfont-5.1 {Tk_MeasureChars procedure: unbounded right margin} -constraint .t.l config -wrap 0 -text "000000" list [expr {[winfo reqwidth .t.l] eq 6*$ax}] \ - [expr {[winfo reqheight .t.l] eq $ay}] + [expr {[winfo reqheight .t.l] eq $ay}] } -cleanup { destroy .t.l } -result {1 1} @@ -155,7 +155,7 @@ test winfont-5.2 {Tk_MeasureChars procedure: static width buffer exceeded} -cons destroy .t.l } -body { label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \ - -text "0" -font systemfixed + -text "0" -font systemfixed pack .t.l update set ax [winfo reqwidth .t.l] @@ -163,7 +163,7 @@ test winfont-5.2 {Tk_MeasureChars procedure: static width buffer exceeded} -cons .t.l config -wrap 100000 -text "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" list [expr {[winfo reqwidth .t.l] eq 256*$ax}] \ - [expr {[winfo reqheight .t.l] eq $ay}] + [expr {[winfo reqheight .t.l] eq $ay}] } -cleanup { destroy .t.l } -result {1 1} @@ -174,7 +174,7 @@ test winfont-5.3 {Tk_MeasureChars procedure: all chars did fit} -constraints { destroy .t.l } -body { label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \ - -text "0" -font systemfixed + -text "0" -font systemfixed pack .t.l update set ax [winfo reqwidth .t.l] @@ -182,7 +182,7 @@ test winfont-5.3 {Tk_MeasureChars procedure: all chars did fit} -constraints { .t.l config -wrap [expr {$ax*10}] -text "00000000" list [expr {[winfo reqwidth .t.l] eq 8*$ax}] \ - [expr {[winfo reqheight .t.l] eq $ay}] + [expr {[winfo reqheight .t.l] eq $ay}] } -cleanup { destroy .t.l } -result {1 1} @@ -193,7 +193,7 @@ test winfont-5.4 {Tk_MeasureChars procedure: not all chars fit} -constraints { destroy .t.l } -body { label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \ - -text "0" -font systemfixed + -text "0" -font systemfixed pack .t.l update set ax [winfo reqwidth .t.l] @@ -201,7 +201,7 @@ test winfont-5.4 {Tk_MeasureChars procedure: not all chars fit} -constraints { .t.l config -wrap [expr {$ax*6}] -text "00000000" list [expr {[winfo reqwidth .t.l] eq 6*$ax}] \ - [expr {[winfo reqheight .t.l] eq 2*$ay}] + [expr {[winfo reqheight .t.l] eq 2*$ay}] } -cleanup { destroy .t.l } -result {1 1} @@ -229,7 +229,7 @@ test winfont-5.6 {Tk_MeasureChars procedure: at least one char on line} -constra destroy .t.l } -body { label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \ - -text "0" -font systemfixed + -text "0" -font systemfixed pack .t.l update set ax [winfo reqwidth .t.l] @@ -237,7 +237,7 @@ test winfont-5.6 {Tk_MeasureChars procedure: at least one char on line} -constra .t.l config -text "000000" -wrap 1 list [expr {[winfo reqwidth .t.l] eq $ax}] \ - [expr {[winfo reqheight .t.l] eq 6*$ay}] + [expr {[winfo reqheight .t.l] eq 6*$ay}] } -cleanup { destroy .t.l } -result {1 1} @@ -248,7 +248,7 @@ test winfont-5.7 {Tk_MeasureChars procedure: whole words} -constraints { destroy .t.l } -body { label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \ - -text "0" -font systemfixed + -text "0" -font systemfixed pack .t.l update set ax [winfo reqwidth .t.l] @@ -256,7 +256,7 @@ test winfont-5.7 {Tk_MeasureChars procedure: whole words} -constraints { .t.l config -wrap [expr {$ax*8}] -text "000000 0000" list [expr {[winfo reqwidth .t.l] eq 6*$ax}] \ - [expr {[winfo reqheight .t.l] eq 2*$ay}] + [expr {[winfo reqheight .t.l] eq 2*$ay}] } -cleanup { destroy .t.l } -result {1 1} @@ -267,7 +267,7 @@ test winfont-5.8 {Tk_MeasureChars procedure: already saw space in line} -constra destroy .t.l } -body { label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \ - -text "0" -font systemfixed + -text "0" -font systemfixed pack .t.l update set ax [winfo reqwidth .t.l] @@ -275,7 +275,7 @@ test winfont-5.8 {Tk_MeasureChars procedure: already saw space in line} -constra .t.l config -wrap [expr {$ax*12}] -text "000000 0000000" list [expr {[winfo reqwidth .t.l] eq 7*$ax}] \ - [expr {[winfo reqheight .t.l] eq 2*$ay}] + [expr {[winfo reqheight .t.l] eq 2*$ay}] } -cleanup { destroy .t.l } -result {1 1} @@ -286,7 +286,7 @@ test winfont-5.9 {Tk_MeasureChars procedure: internal spaces significant} -const destroy .t.l } -body { label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \ - -text "0" -font systemfixed + -text "0" -font systemfixed pack .t.l update set ax [winfo reqwidth .t.l] @@ -294,7 +294,7 @@ test winfont-5.9 {Tk_MeasureChars procedure: internal spaces significant} -const .t.l config -wrap [expr {$ax*12}] -text "000 00 00000" list [expr {[winfo reqwidth .t.l] eq 7*$ax}] \ - [expr {[winfo reqheight .t.l] eq 2*$ay}] + [expr {[winfo reqheight .t.l] eq 2*$ay}] } -cleanup { destroy .t.l } -result {1 1} @@ -305,7 +305,7 @@ test winfont-5.10 {Tk_MeasureChars procedure: make first part of word fit} -cons destroy .t.l } -body { label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \ - -text "0" -font systemfixed + -text "0" -font systemfixed pack .t.l update set ax [winfo reqwidth .t.l] @@ -313,7 +313,7 @@ test winfont-5.10 {Tk_MeasureChars procedure: make first part of word fit} -cons .t.l config -wrap [expr {$ax*12}] -text "0000000000000000" list [expr {[winfo reqwidth .t.l] eq 12*$ax}] \ - [expr {[winfo reqheight .t.l] eq 2*$ay}] + [expr {[winfo reqheight .t.l] eq 2*$ay}] } -cleanup { destroy .t.l } -result {1 1} @@ -324,7 +324,7 @@ test winfont-5.11 {Tk_MeasureChars procedure: check for kerning} -constraints { destroy .t.l } -body { label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \ - -text "0" -font systemfixed + -text "0" -font systemfixed pack .t.l update @@ -344,7 +344,7 @@ test winfont-6.1 {Tk_DrawChars procedure: loop test} -constraints win -setup { destroy .t.l } -body { label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \ - -text "0" -font systemfixed + -text "0" -font systemfixed pack .t.l update .t.l config -text "a" diff --git a/tests/winMenu.test b/tests/winMenu.test index 2382d13..633034e 100644 --- a/tests/winMenu.test +++ b/tests/winMenu.test @@ -470,8 +470,8 @@ test winMenu-11.3 {TkWinHandleMenuEvent - WM_COMMAND} -constraints { } -body { catch {unset foo} proc bgerror {args} { - global foo errorInfo - set foo [list $args $errorInfo] + global foo errorInfo + set foo [list $args $errorInfo] } menu .m1 .m1 add command -command {error 1} -label "winMenu-11.2: Please select this menu item." diff --git a/tests/winMsgbox.test b/tests/winMsgbox.test index cf7a05f..ea81266 100644 --- a/tests/winMsgbox.test +++ b/tests/winMsgbox.test @@ -25,11 +25,11 @@ proc GetWindowInfo {title button} { array set a $windowInfo set childinfo {} ; set childtext "" foreach child $a(children) { - lappend childinfo $child [set info [testgetwindowinfo $child]] - array set ca $info - if {$ca(class) eq "Static"} { - append childtext $ca(text) - } + lappend childinfo $child [set info [testgetwindowinfo $child]] + array set ca $info + if {$ca(class) eq "Static"} { + append childtext $ca(text) + } } set a(children) $childinfo set a(childtext) $childtext @@ -261,7 +261,7 @@ test winMsgbox-3.1 {tk_messageBox detail (sourceforge bug #1692927)} -constraint set title "winMsgbox-3.0 [pid]" after 100 [list GetWindowInfo $title 2] set r [tk_messageBox -type ok -title $title \ - -message Hello -detail "Pleased to meet you"] + -message Hello -detail "Pleased to meet you"] array set info $windowInfo lappend r $info(childtext) } -cleanup { diff --git a/tests/winWm.test b/tests/winWm.test index 35775a2..783a4e1 100644 --- a/tests/winWm.test +++ b/tests/winWm.test @@ -324,14 +324,14 @@ test winWm-6.6 {wm attributes -alpha} -constraints win -setup { update if {$::tcl_platform(osVersion) >= 5.0} { for {set i 0.2} {$i < 0.99} {set i [expr {$i+0.02}]} { - wm attributes .t -alpha $i - update idle - after 20 + wm attributes .t -alpha $i + update idle + after 20 } for {set i 0.99} {$i > 0.2} {set i [expr {$i-0.02}]} { - wm attributes .t -alpha $i - update idle - after 20 + wm attributes .t -alpha $i + update idle + after 20 } } } -cleanup { @@ -366,7 +366,7 @@ test winWm-6.8 {wm attributes -transparentcolor} -constraints win -setup { test winWm-7.1 {deiconify on an unmapped toplevel will raise \ - the window and set the focus} -constraints { + the window and set the focus} -constraints { win } -setup { destroy .t @@ -382,7 +382,7 @@ test winWm-7.1 {deiconify on an unmapped toplevel will raise \ } -result {1 .t} test winWm-7.2 {deiconify on an already mapped toplevel\ - will raise the window and set the focus} -constraints { + will raise the window and set the focus} -constraints { win } -setup { destroy .t @@ -446,31 +446,31 @@ test winWm-8.2 {Tk_WmCmd procedure, "iconphoto" option} -constraints win -setup test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -constraints win -setup { proc winwm90click {w} { - if {![winfo ismapped $w]} { update } - event generate $w <Enter> - focus -force $w - event generate $w <Button-1> -x 5 -y 5 - event generate $w <ButtonRelease-1> -x 5 -y 5 + if {![winfo ismapped $w]} { update } + event generate $w <Enter> + focus -force $w + event generate $w <Button-1> -x 5 -y 5 + event generate $w <ButtonRelease-1> -x 5 -y 5 } proc winwm90proc3 {} { - global winwm90done winwm90check - set w .sd - toplevel $w - pack [button $w.b -text "OK" -command {set winwm90check 1}] - bind $w.b <Map> {after idle {winwm90click %W}} - update idletasks - tkwait visibility $w - grab $w - tkwait variable winwm90check - grab release $w - destroy $w - after idle {set winwm90done ok} + global winwm90done winwm90check + set w .sd + toplevel $w + pack [button $w.b -text "OK" -command {set winwm90check 1}] + bind $w.b <Map> {after idle {winwm90click %W}} + update idletasks + tkwait visibility $w + grab $w + tkwait variable winwm90check + grab release $w + destroy $w + after idle {set winwm90done ok} } proc winwm90proc2 {w} { winwm90proc3; destroy $w } proc winwm90proc1 {w} { - toplevel $w - pack [button $w.b -text "Do dialog" -command [list winwm90proc2 $w]] - bind $w.b <Map> {bind %W <Map> {}; after idle {winwm90click %W}} + toplevel $w + pack [button $w.b -text "Do dialog" -command [list winwm90proc2 $w]] + bind $w.b <Map> {bind %W <Map> {}; after idle {winwm90click %W}} } global winwm90done set winwm90done wait @@ -483,38 +483,38 @@ test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -constrai set winwm90done } -cleanup { foreach cmd {proc1 proc2 proc3 click} { - rename winwm90$cmd {} + rename winwm90$cmd {} } destroy .tx .t .sd } -result ok test winWm-9.1 "delayed activation of grabbed destroyed window" -constraints win -setup { proc winwm91click {w} { - if {![winfo ismapped $w]} { update } - event generate $w <Enter> - focus -force $w - event generate $w <Button-1> -x 5 -y 5 - event generate $w <ButtonRelease-1> -x 5 -y 5 + if {![winfo ismapped $w]} { update } + event generate $w <Enter> + focus -force $w + event generate $w <Button-1> -x 5 -y 5 + event generate $w <ButtonRelease-1> -x 5 -y 5 } proc winwm91proc3 {} { - global winwm91done winwm91check - set w .sd - toplevel $w - pack [button $w.b -text "OK" -command {set winwm91check 1}] - bind $w.b <Map> {after idle {winwm91click %W}} - update idletasks - tkwait visibility $w - grab $w - tkwait variable winwm91check - #skip the release: #grab release $w - destroy $w - after idle {set winwm91done ok} + global winwm91done winwm91check + set w .sd + toplevel $w + pack [button $w.b -text "OK" -command {set winwm91check 1}] + bind $w.b <Map> {after idle {winwm91click %W}} + update idletasks + tkwait visibility $w + grab $w + tkwait variable winwm91check + #skip the release: #grab release $w + destroy $w + after idle {set winwm91done ok} } proc winwm91proc2 {w} { winwm91proc3; destroy $w } proc winwm91proc1 {w} { - toplevel $w - pack [button $w.b -text "Do dialog" -command [list winwm91proc2 $w]] - bind $w.b <Map> {bind %W <Map> {}; after idle {winwm91click %W}} + toplevel $w + pack [button $w.b -text "Do dialog" -command [list winwm91proc2 $w]] + bind $w.b <Map> {bind %W <Map> {}; after idle {winwm91click %W}} } destroy .t global winwm91done @@ -528,7 +528,7 @@ test winWm-9.1 "delayed activation of grabbed destroyed window" -constraints win set winwm91done } -cleanup { foreach cmd {proc1 proc2 proc3 click} { - rename winwm91$cmd {} + rename winwm91$cmd {} } destroy .tx .t .sd } -result ok @@ -543,18 +543,18 @@ test winWm-9.2 "check wm forget for unmapped parent (#3205464,#2967911)" -constr pack .t.f.x pack .t.f lappend aid [after 5000 {set ::winwm92 timeout}] [after 500 { - wm manage .t.f - wm iconify .t - lappend aid [after 500 { - wm forget .t.f - wm deiconify .t - lappend aid [after 500 { - pack .t.f - lappend aid [after 500 { + wm manage .t.f + wm iconify .t + lappend aid [after 500 { + wm forget .t.f + wm deiconify .t + lappend aid [after 500 { + pack .t.f + lappend aid [after 500 { set ::winwm92 [expr { [winfo rooty .t.f.x] == 0 ? "failed" : "ok"}]}] - }] - }] + }] + }] }] vwait ::winwm92 foreach id $aid { diff --git a/tests/window.test b/tests/window.test index 8a56d5a..de34221 100644 --- a/tests/window.test +++ b/tests/window.test @@ -11,7 +11,8 @@ tcltest::configure {*}$argv tcltest::loadTestedCommands namespace import ::tk::test::loadTkCommand update - +# Move the mouse out of the way for window-2.1 +event generate {} <Motion> -warp 1 -x 640 -y 10 # XXX This file is woefully incomplete. Right now it only tests # a few parts of a few procedures in tkWindow.c @@ -21,8 +22,8 @@ test window-1.1 {Tk_CreateWindowFromPath procedure, parent dead} -setup { destroy .t } -body { proc bgerror msg { - global x errorInfo - set x [list $msg $errorInfo] + global x errorInfo + set x [list $msg $errorInfo] } set x unchanged @@ -90,15 +91,15 @@ test window-2.4 {Tk_DestroyWindow, cleanup half dead window at exit} -constraint } -body { set code [loadTkCommand] append code { - update - bind . <Destroy> exit - destroy . + update + bind . <Destroy> exit + destroy . } set script [makeFile $code script] if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 + set error 1 } else { - set error 0 + set error 0 } removeFile script list $error $msg @@ -109,16 +110,16 @@ test window-2.5 {Tk_DestroyWindow, cleanup half dead windows at exit} -constrain } -body { set code [loadTkCommand] append code { - toplevel .t - update - bind .t <Destroy> exit - destroy .t + toplevel .t + update + bind .t <Destroy> exit + destroy .t } set script [makeFile $code script] if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 + set error 1 } else { - set error 0 + set error 0 } removeFile script list $error $msg @@ -129,16 +130,16 @@ test window-2.6 {Tk_DestroyWindow, cleanup half dead windows at exit} -constrain } -body { set code [loadTkCommand] append code { - toplevel .t - update - bind .t <Destroy> exit - destroy . + toplevel .t + update + bind .t <Destroy> exit + destroy . } set script [makeFile $code script] if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 + set error 1 } else { - set error 0 + set error 0 } removeFile script list $error $msg @@ -149,17 +150,17 @@ test window-2.7 {Tk_DestroyWindow, cleanup half dead windows at exit} -constrain } -body { set code [loadTkCommand] append code { - toplevel .t - toplevel .t.f - update - bind .t.f <Destroy> exit - destroy . + toplevel .t + toplevel .t.f + update + bind .t.f <Destroy> exit + destroy . } set script [makeFile $code script] if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 + set error 1 } else { - set error 0 + set error 0 } removeFile script list $error $msg @@ -170,20 +171,20 @@ test window-2.8 {Tk_DestroyWindow, cleanup half dead windows at exit} -constrain } -body { set code [loadTkCommand] append code { - toplevel .t1 - toplevel .t2 - toplevel .t3 - update - bind .t3 <Destroy> {destroy .t2} - bind .t2 <Destroy> {destroy .t1} - bind .t1 <Destroy> {exit 0} - destroy .t3 + toplevel .t1 + toplevel .t2 + toplevel .t3 + update + bind .t3 <Destroy> {destroy .t2} + bind .t2 <Destroy> {destroy .t1} + bind .t1 <Destroy> {exit 0} + destroy .t3 } set script [makeFile $code script] if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 + set error 1 } else { - set error 0 + set error 0 } removeFile script list $error $msg @@ -194,18 +195,18 @@ test window-2.9 {Tk_DestroyWindow, Destroy bindings evaluated after exit} -const } -body { set code [loadTkCommand] append code { - toplevel .t1 - toplevel .t2 - update - bind .t2 <Destroy> {puts "Destroy .t2" ; exit 1} - bind .t1 <Destroy> {puts "Destroy .t1" ; exit 0} - destroy .t2 + toplevel .t1 + toplevel .t2 + update + bind .t2 <Destroy> {puts "Destroy .t2" ; exit 1} + bind .t1 <Destroy> {puts "Destroy .t1" ; exit 0} + destroy .t2 } set script [makeFile $code script] if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 + set error 1 } else { - set error 0 + set error 0 } removeFile script list $error $msg @@ -217,19 +218,19 @@ test window-2.10 {Tk_DestroyWindow, Destroy binding evaluated once} -constraints } -body { set code [loadTkCommand] append code { - update - bind . <Destroy> { - puts "Destroy ." - bind . <Destroy> {puts "Re-Destroy ."} - exit 0 - } - destroy . + update + bind . <Destroy> { + puts "Destroy ." + bind . <Destroy> {puts "Re-Destroy ."} + exit 0 + } + destroy . } set script [makeFile $code script] if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 + set error 1 } else { - set error 0 + set error 0 } removeFile script list $error $msg @@ -240,24 +241,24 @@ test window-2.11 {Tk_DestroyWindow, don't reanimate a half-dead window} -constra } -body { set code [loadTkCommand] append code { - toplevel .t1 - toplevel .t2 - update - bind .t1 <Destroy> { - if {[catch {entry .t2.newchild}]} { - puts YES - } else { - puts NO - } - } - bind .t2 <Destroy> {exit} - destroy .t2 + toplevel .t1 + toplevel .t2 + update + bind .t1 <Destroy> { + if {[catch {entry .t2.newchild}]} { + puts YES + } else { + puts NO + } + } + bind .t2 <Destroy> {exit} + destroy .t2 } set script [makeFile $code script] if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 + set error 1 } else { - set error 0 + set error 0 } removeFile script list $error $msg @@ -283,16 +284,16 @@ test window-2.12 {Test for ticket [9b6065d1fd] - restore Tcl [update] command} - } set script [makeFile $code script] if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 + set error 1 } else { - set error 0 + set error 0 } removeFile script list $error $msg } -result {0 {waiting -ringing the bell -> can't invoke "bell" command: application has been destroyed +ringing the bell -> cannot invoke "bell" command: application has been destroyed done waiting -bell -> can't invoke "bell" command: application has been destroyed +bell -> cannot invoke "bell" command: application has been destroyed update -> }} diff --git a/tests/winfo.test b/tests/winfo.test index d4cc1ff..76c57c9 100644 --- a/tests/winfo.test +++ b/tests/winfo.test @@ -29,12 +29,12 @@ proc eatColors {w {options ""}} { canvas $w.c -width 400 -height 200 -bd 0 pack $w.c for {set y 0} {$y < 8} {incr y} { - for {set x 0} {$x < 40} {incr x} { - set color [format #%02x%02x%02x [expr {$x*6}] [expr {$y*30}] 0] - $w.c create rectangle [expr {10*$x}] [expr {20*$y}] \ - [expr {10*$x + 10}] [expr {20*$y + 20}] -outline {} \ - -fill $color - } + for {set x 0} {$x < 40} {incr x} { + set color [format #%02x%02x%02x [expr {$x*6}] [expr {$y*30}] 0] + $w.c create rectangle [expr {10*$x}] [expr {20*$y}] \ + [expr {10*$x + 10}] [expr {20*$y + 20}] -outline {} \ + -fill $color + } } update } @@ -173,7 +173,7 @@ test winfo-4.7 {"winfo containing" command} -setup { update set x [winfo containing -display .t.f [expr {[winfo rootx .t]+600}] \ - [expr {[winfo rooty .t.f]+450}]] + [expr {[winfo rooty .t.f]+450}]] expr {($x == ".") || ($x == "")} } -cleanup { destroy .t @@ -239,7 +239,7 @@ test winfo-7.5 {"winfo pathname" command} -body { } -returnCodes error -result {expected integer but got "xyz"} test winfo-7.6 {"winfo pathname" command} -body { winfo pathname 224 -} -returnCodes error -result {window id "224" doesn't exist in this application} +} -returnCodes error -result {window id "224" does not exist in this application} test winfo-7.7 {"winfo pathname" command} -setup { destroy .b button .b -text "Help" @@ -392,7 +392,7 @@ test winfo-13.1 {root coordinates of embedded toplevel} -setup { update list rootx [expr {[winfo rootx .emb] == [winfo rootx .con]}] \ - rooty [expr {[winfo rooty .emb] == [winfo rooty .con]}] + rooty [expr {[winfo rooty .emb] == [winfo rooty .con]}] } -cleanup { deleteWindows } -result {rootx 1 rooty 1} @@ -441,8 +441,10 @@ test winfo-13.3 {destroying container window} -setup { test winfo-13.4 {[winfo containing] with embedded windows} -setup { deleteWindows } -body { + wm geometry . +100+100 frame .con -container 1 pack .con -expand yes -fill both + update toplevel .emb -use [winfo id .con] -bd 0 -highlightthickness 0 button .emb.b pack .emb.b -expand yes -fill both @@ -452,7 +454,7 @@ test winfo-13.4 {[winfo containing] with embedded windows} -setup { pack .b -expand yes -fill both update string compare .emb.b \ - [winfo containing [winfo rootx .emb.b] [winfo rooty .emb.b]] + [winfo containing [winfo rootx .emb.b] [winfo rooty .emb.b]] } -cleanup { deleteWindows } -result 0 diff --git a/tests/wm.test b/tests/wm.test index d913006..ea366a5 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -620,7 +620,7 @@ test wm-deiconify-1.6 {usage} -constraints !win -setup { deleteWindows test wm-deiconify-2.1 {a window that has never been mapped\ - should not be mapped by a call to deiconify} -body { + should not be mapped by a call to deiconify} -body { toplevel .t wm deiconify .t winfo ismapped .t @@ -628,7 +628,7 @@ test wm-deiconify-2.1 {a window that has never been mapped\ deleteWindows } -result 0 test wm-deiconify-2.2 {a window that has already been\ - mapped should be mapped by deiconify} -body { + mapped should be mapped by deiconify} -body { toplevel .t update idletasks wm withdraw .t @@ -638,8 +638,8 @@ test wm-deiconify-2.2 {a window that has already been\ deleteWindows } -result 1 test wm-deiconify-2.3 {geometry for an unmapped window\ - should not be calculated by a call to deiconify,\ - it should be done at idle time} -setup { + should not be calculated by a call to deiconify,\ + it should be done at idle time} -setup { set results {} } -body { toplevel .t -width 200 -height 200 @@ -648,13 +648,13 @@ test wm-deiconify-2.3 {geometry for an unmapped window\ lappend results [wm geometry .t] update idletasks lappend results [lindex [split \ - [wm geometry .t] +] 0] + [wm geometry .t] +] 0] } -cleanup { deleteWindows } -result {1x1+0+0 1x1+0+0 200x200} test wm-deiconify-2.4 {invoking destroy after a deiconify\ - should not result in a crash because of a callback\ - set on the toplevel} -body { + should not result in a crash because of a callback\ + set on the toplevel} -body { toplevel .t wm withdraw .t wm deiconify .t @@ -821,10 +821,10 @@ test wm-iconbadge-1.4 {::tk::icons::base_icon($win) must be a Tk photo on X11} - } -returnCodes error -result {can't use "book" as iconphoto: not a photo image} test wm-iconbadge-1.5 {illegal badge number} -body { image create photo book -data { - R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC - wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM - QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc - 0yv+DVSEUuFxIAOw== + R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC + wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM + QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc + 0yv+DVSEUuFxIAOw== } set ::tk::icons::base_icon(.) book wm iconbadge . illegal @@ -833,10 +833,10 @@ test wm-iconbadge-1.5 {illegal badge number} -body { } -returnCodes error -result {can't use "illegal" as icon badge} test wm-iconbadge-1.6 {non-integer badge number} -body { image create photo book -data { - R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC - wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM - QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc - 0yv+DVSEUuFxIAOw== + R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC + wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM + QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc + 0yv+DVSEUuFxIAOw== } set ::tk::icons::base_icon(.) book wm iconbadge . 3.2 @@ -845,10 +845,10 @@ test wm-iconbadge-1.6 {non-integer badge number} -body { } -returnCodes error -result {can't use "3.2" as icon badge} test wm-iconbadge-1.7 {negative or zero badge number} -body { image create photo book -data { - R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC - wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM - QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc - 0yv+DVSEUuFxIAOw== + R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC + wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM + QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc + 0yv+DVSEUuFxIAOw== } set ::tk::icons::base_icon(.) book wm iconbadge . 0 @@ -1016,7 +1016,7 @@ test wm-iconphoto-1.4 {usage} -returnCodes error -body { } -result {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"} test wm-iconphoto-1.5.1 {usage} -constraints aquaOrWin32 -returnCodes error -body { wm iconphoto . -default [image create photo -file {}] -} -match {glob} -result {failed to create an iconphoto with image *} +} -match glob -result {failed to create an iconphoto with image *} test wm-iconphoto-1.5.2 {usage} -constraints x11 -body { wm iconphoto . -default [image create photo -file {}] } -result {} @@ -1084,6 +1084,8 @@ test wm-iconwindow-1.5 {usage} -setup { } -result {.icon is already an icon for .t2} test wm-iconwindow-2.1 {setting and reading values} -setup { + # without this macOS crashes for unknown reasons + wm iconwindow .t {} destroy .icon set result {} } -body { @@ -1136,7 +1138,7 @@ test wm-maxsize-1.7 {maxsize must be <= screen size} -setup { destroy .t test wm-maxsize-2.1 {setting the maxsize to a value smaller\ - than the current size will resize a toplevel} -body { + than the current size will resize a toplevel} -body { toplevel .t -width 300 -height 300 update wm maxsize .t 200 150 @@ -1147,7 +1149,7 @@ test wm-maxsize-2.1 {setting the maxsize to a value smaller\ destroy .t } -result {200 150} test wm-maxsize-2.2 {setting the maxsize to a value smaller\ - than the current size will resize a gridded toplevel} -body { + than the current size will resize a gridded toplevel} -body { toplevel .t wm grid .t 0 0 50 50 wm geometry .t 6x6 @@ -1160,7 +1162,7 @@ test wm-maxsize-2.2 {setting the maxsize to a value smaller\ destroy .t } -result {4 3} test wm-maxsize-2.3 {attempting to resize to a value\ - bigger than the current maxsize will set it to the max size} -body { + bigger than the current maxsize will set it to the max size} -body { toplevel .t -width 200 -height 200 wm maxsize .t 300 250 update @@ -1224,7 +1226,7 @@ test wm-minsize-1.6 {usage} -setup { } -result {300 200} test wm-minsize-2.1 {setting the minsize to a value larger\ - than the current size will resize a toplevel} -body { + than the current size will resize a toplevel} -body { toplevel .t -width 200 -height 200 update wm minsize .t 400 300 @@ -1235,7 +1237,7 @@ test wm-minsize-2.1 {setting the minsize to a value larger\ destroy .t } -result {400 300} test wm-minsize-2.2 {setting the minsize to a value larger\ - than the current size will resize a gridded toplevel} -body { + than the current size will resize a gridded toplevel} -body { toplevel .t wm grid .t 1 1 50 50 wm geom .t 4x4 @@ -1248,7 +1250,7 @@ test wm-minsize-2.2 {setting the minsize to a value larger\ destroy .t } -result {8 8} test wm-minsize-2.3 {attempting to resize to a value\ - smaller than the current minsize will set it to the minsize} -body { + smaller than the current minsize will set it to the minsize} -body { toplevel .t -width 400 -height 400 wm minsize .t 300 300 update @@ -1502,18 +1504,24 @@ test wm-stackorder-2.2 {stacking order} -body { destroy .t } -result {.t .} test wm-stackorder-2.3 {stacking order} -body { + set res {} toplevel .t tkwait visibility .t + raiseDelay toplevel .t2 tkwait visibility .t2 + raiseDelay + lappend res [wm stackorder .] raise . raiseDelay + lappend res [wm stackorder .] raise .t2 raiseDelay - wm stackorder . + lappend res [wm stackorder .] + set res } -cleanup { destroy .t .t2 -} -result {.t . .t2} +} -result {{. .t .t2} {.t .t2 .} {.t . .t2}} test wm-stackorder-2.4 {stacking order} -body { toplevel .t ; update toplevel .t2 ; update @@ -1561,7 +1569,9 @@ deleteWindows test wm-stackorder-3.1 {unmapped toplevel} -constraints {failsOnUbuntu failsOnXQuarz} -body { toplevel .t1 ; update + raiseDelay toplevel .t2 ; update + raiseDelay wm iconify .t1 raiseDelay wm stackorder . @@ -1700,7 +1710,7 @@ test wm-stackorder-5.2.1 {A normal toplevel can be raised above an \ destroy .t } -result 1 test wm-stackorder-5.3 {An overrideredirect window\ - can be explicitly lowered} -body { + can be explicitly lowered} -body { toplevel .t wm overrideredirect .t 1 tkwait visibility .t @@ -1833,7 +1843,7 @@ test wm-transient-2.2 {first toplevel parent of non-toplevel container window is } -result {.top} test wm-transient-3.1 {transient toplevel is withdrawn - when mapped if toplevel is withdrawn} -body { + when mapped if toplevel is withdrawn} -body { toplevel .top wm withdraw .top update @@ -1845,7 +1855,7 @@ test wm-transient-3.1 {transient toplevel is withdrawn deleteWindows } -result {withdrawn 0} test wm-transient-3.2 {already mapped transient toplevel - takes on withdrawn state of toplevel} -body { + takes on withdrawn state of toplevel} -body { toplevel .top wm withdraw .top update @@ -1858,7 +1868,7 @@ test wm-transient-3.2 {already mapped transient toplevel deleteWindows } -result {withdrawn 0} test wm-transient-3.3 {withdraw/deiconify on the toplevel - also does a withdraw/deiconify on the transient} -setup { + also does a withdraw/deiconify on the transient} -setup { set results [list] } -body { toplevel .top @@ -1876,7 +1886,7 @@ test wm-transient-3.3 {withdraw/deiconify on the toplevel } -result {withdrawn 0 normal 1} test wm-transient-4.1 {transient toplevel is withdrawn - when mapped if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body { + when mapped if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body { toplevel .top wm iconify .top update @@ -1888,7 +1898,7 @@ test wm-transient-4.1 {transient toplevel is withdrawn deleteWindows } -result {withdrawn 0} test wm-transient-4.2 {already mapped transient toplevel - is withdrawn if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body { + is withdrawn if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body { toplevel .top raiseDelay wm iconify .top @@ -1902,7 +1912,7 @@ test wm-transient-4.2 {already mapped transient toplevel deleteWindows } -result {withdrawn 0} test wm-transient-4.3 {iconify/deiconify on the toplevel - does a withdraw/deiconify on the transient} -constraints {failsOnUbuntu failsOnXQuarz} -setup { + does a withdraw/deiconify on the transient} -constraints {failsOnUbuntu failsOnXQuarz} -setup { set results [list] } -body { toplevel .top @@ -1920,7 +1930,7 @@ test wm-transient-4.3 {iconify/deiconify on the toplevel } -result {withdrawn 0 normal 1} test wm-transient-5.1 {an error during transient command should not - cause the map/unmap binding to be deleted} -setup { + cause the map/unmap binding to be deleted} -setup { set results [list] } -body { toplevel .top @@ -1939,7 +1949,7 @@ test wm-transient-5.1 {an error during transient command should not deleteWindows } -result {1 withdrawn normal} test wm-transient-5.2 {remove transient property when toplevel - is destroyed} -body { + is destroyed} -body { toplevel .top toplevel .subject wm transient .subject .top @@ -1951,7 +1961,7 @@ test wm-transient-5.2 {remove transient property when toplevel deleteWindows } -result {} test wm-transient-5.3 {remove transient property from window - that had never been mapped when toplevel is destroyed} -body { + that had never been mapped when toplevel is destroyed} -body { toplevel .top toplevel .subject wm transient .subject .top @@ -1962,7 +1972,7 @@ test wm-transient-5.3 {remove transient property from window } -result {} test wm-transient-6.1 {a withdrawn transient does not track - state changes in the toplevel} -body { + state changes in the toplevel} -body { toplevel .top toplevel .subject update @@ -1977,7 +1987,7 @@ test wm-transient-6.1 {a withdrawn transient does not track deleteWindows } -result {withdrawn} test wm-transient-6.2 {a withdrawn transient does not track - state changes in the toplevel} -setup { + state changes in the toplevel} -setup { set results [list] } -body { toplevel .top @@ -2002,7 +2012,7 @@ test wm-transient-6.2 {a withdrawn transient does not track deleteWindows } -result {withdrawn normal withdrawn normal} test wm-transient-6.3 {a withdrawn transient does not track - state changes in the toplevel} -body { + state changes in the toplevel} -body { toplevel .top toplevel .subject update @@ -2059,7 +2069,7 @@ test wm-transient-7.4 {Reassign transient, destroy new toplevel} -body { toplevel .transient wm transient .transient .t1 wm transient .transient .t2 - destroy .t2 ;# caused panic in 8.4b1 + destroy .t2 ;# caused panic in 8.4b1 destroy .t1 destroy .transient } -cleanup { @@ -2072,7 +2082,7 @@ test wm-transient-7.5 {Reassign transient, destroy transient} -body { wm transient .transient .t1 wm transient .transient .t2 destroy .transient - destroy .t2 ;# caused panic in 8.4b1 + destroy .t2 ;# caused panic in 8.4b1 destroy .t1 ;# so did this } -cleanup { deleteWindows diff --git a/tests/xmfbox.test b/tests/xmfbox.test index 89eda3c..b584aeb 100644 --- a/tests/xmfbox.test +++ b/tests/xmfbox.test @@ -27,25 +27,25 @@ proc cleanup {} { set err1 [catch { if [file exists ./~nosuchuser1] { - file delete ./~nosuchuser1 + file delete ./~nosuchuser1 } } msg1] set err2 [catch { if [file exists ./~nosuchuser2] { - file delete ./~nosuchuser2 + file delete ./~nosuchuser2 } } msg2] set err3 [catch { if [file exists ./~nosuchuser3] { - file delete ./~nosuchuser3 + file delete ./~nosuchuser3 } } msg3] set err4 [catch { if [file exists ./~nosuchuser4] { - file delete ./~nosuchuser4 + file delete ./~nosuchuser4 } } msg4] @@ -54,6 +54,7 @@ proc cleanup {} { } catch {unset foo} destroy .foo + update } # ---------------------------------------------------------------------- @@ -76,6 +77,7 @@ test xmfbox-1.2 {tk::MotifFDialog_Create, -parent switch} -constraints { } -body { toplevel .bar wm geometry .bar +0+0 + update set x [tk::MotifFDialog_Create foo open {-parent .bar}] } -cleanup { destroy $x @@ -89,6 +91,7 @@ test xmfbox-2.1 {tk::MotifFDialog_InterpFilter, ~ in dir names} -constraints { cleanup file mkdir ./~nosuchuser1 set x [tk::MotifFDialog_Create foo open {}] + update $::tk::dialog::file::foo(fEnt) delete 0 end $::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1 file normalize [file join {*}[tk::MotifFDialog_InterpFilter $x]] @@ -100,6 +103,7 @@ test xmfbox-2.2 {tk::MotifFDialog_InterpFilter, ~ in file names} -constraints { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] set x [tk::MotifFDialog_Create foo open {}] + update $::tk::dialog::file::foo(fEnt) delete 0 end $::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1 file normalize [file join {*}[tk::MotifFDialog_InterpFilter $x]] @@ -111,6 +115,7 @@ test xmfbox-2.3 {tk::MotifFDialog_Update, ~ in file names} -constraints { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] set x [tk::MotifFDialog_Create foo open {}] + update $::tk::dialog::file::foo(fEnt) delete 0 end $::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1 tk::MotifFDialog_InterpFilter $x @@ -124,6 +129,7 @@ test xmfbox-2.4 {tk::MotifFDialog_LoadFile, ~ in file names} -constraints { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] set x [tk::MotifFDialog_Create foo open {}] + update set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1] expr {$i >= 0} } -result 1 @@ -134,6 +140,7 @@ test xmfbox-2.5 {tk::MotifFDialog_BrowseFList, ~ in file names} -constraints { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] set x [tk::MotifFDialog_Create foo open {}] + update set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1] $::tk::dialog::file::foo(fList) selection clear 0 end $::tk::dialog::file::foo(fList) selection set $i |
