diff options
Diffstat (limited to 'tests')
48 files changed, 676 insertions, 730 deletions
diff --git a/tests/bind.test b/tests/bind.test index 7b7fb62..73d2a09 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -36,22 +36,12 @@ proc unsetBindings {} { # move the mouse pointer away of the testing area # otherwise some spurious events may pollute the tests -# also, this will procure a known grab state at startup -# for tests mixing grabs and pointer warps -proc pointerAway {} { - toplevel .top - wm geometry .top 50x50-50-50 - update - # On KDE/Plasma _with_the_Aurorae_theme_ (at least), setting up the toplevel - # will not be finished right after the above 'update'. The WM still - # needs some time before the window is fully ready. For me 50 ms is enough, - # but let's wait more (it depends on computer performance). - after 100 ; update - event generate .top <Button-1> -warp 1 - controlPointerWarpTiming - destroy .top -} -pointerAway +toplevel .top +wm geometry .top 50x50-50-50 +update +event generate .top <Button-1> -warp 1 +controlPointerWarpTiming +destroy .top test bind-1.1 {bind command} -body { bind @@ -3093,7 +3083,7 @@ test bind-22.32 {HandleEventGenerate: options <Expose> -count 20} -setup { return $x } -cleanup { destroy .t.f -} -result {20} +} -result 20 test bind-22.33 {HandleEventGenerate: options <Key> -count 20} -setup { frame .t.f -class Test -width 150 -height 100 @@ -6950,7 +6940,8 @@ test bind-35.3 {Events agree for modifier keys} -constraints {aqua} -setup { } -result pass test bind-36.1 {pointer warp with grab on toplevel, bug [e3888d5820]} -setup { - pointerAway + event generate {} <Motion> -warp 1 -x 50 -y 50 + controlPointerWarpTiming toplevel .top grab release .top wm geometry .top 200x200+300+300 @@ -6964,17 +6955,13 @@ test bind-36.1 {pointer warp with grab on toplevel, bug [e3888d5820]} -setup { # but let's wait more (it depends on computer performance). after 100 ; update } -body { - grab .top ; # this will queue events - after 50 - update + grab .top event generate .top.l <Motion> -warp 1 -x 10 -y 10 controlPointerWarpTiming foreach {x1 y1} [winfo pointerxy .top.l] {} event generate {} <Motion> -warp 1 -x 50 -y 50 controlPointerWarpTiming - grab release .top ; # this will queue events - after 50 - update + grab release .top event generate .top.l <Motion> -warp 1 -x 10 -y 10 controlPointerWarpTiming foreach {x2 y2} [winfo pointerxy .top.l] {} diff --git a/tests/border.test b/tests/border.test index e13d52a..d6ff5c7 100644 --- a/tests/border.test +++ b/tests/border.test @@ -127,6 +127,7 @@ test border-2.2 {Tk_Free3DBorder - unlinking from list} -constraints { destroy .b .t2 .t3 .t } -result {{{4 1} {3 0} {2 0} {1 0}} {{4 1} {2 0} {1 0}} {{4 1} {2 0}} {{2 0}} {}} + test border-3.1 {FreeBorderObjProc} -constraints { testborder } -setup { diff --git a/tests/busy.test b/tests/busy.test index 98d83a8..ae7a2a5 100644 --- a/tests/busy.test +++ b/tests/busy.test @@ -342,14 +342,14 @@ test busy-6.1 {tk busy status} -returnCodes error -body { } -result {wrong # args: should be "tk busy status window"} test busy-6.2 {tk busy status non existing window} -body { tk busy status .f -} -result {0} +} -result 0 test busy-6.3 {tk busy status non busy window} -setup { pack [frame .f] } -body { tk busy status .f } -cleanup { destroy .f -} -result {0} +} -result 0 test busy-6.4 {tk busy status busy window} -setup { pack [frame .f] tk busy hold .f @@ -359,7 +359,7 @@ test busy-6.4 {tk busy status busy window} -setup { } -cleanup { tk busy forget .f destroy .f -} -result {1} +} -result 1 test busy-6.5 {tk busy status forgotten busy window} -setup { pack [frame .f] tk busy hold .f @@ -369,7 +369,7 @@ test busy-6.5 {tk busy status forgotten busy window} -setup { tk busy status .f } -cleanup { destroy .f -} -result {0} +} -result 0 test busy-7.1 {tk busy current no busy} -body { tk busy current diff --git a/tests/button.test b/tests/button.test index f3292b31..9a69b1b 100644 --- a/tests/button.test +++ b/tests/button.test @@ -334,7 +334,7 @@ test button-1.33 {configuration option: "bd" for label} -setup { .l cget -bd } -cleanup { destroy .l -} -result {4} +} -result 4 test button-1.34 {configuration option: "bd" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .l @@ -353,7 +353,7 @@ test button-1.35 {configuration option: "bd" for button} -setup { .b cget -bd } -cleanup { destroy .b -} -result {4} +} -result 4 test button-1.36 {configuration option: "bd" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -372,7 +372,7 @@ test button-1.37 {configuration option: "bd" for checkbutton} -setup { .c cget -bd } -cleanup { destroy .c -} -result {4} +} -result 4 test button-1.38 {configuration option: "bd" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -391,7 +391,7 @@ test button-1.39 {configuration option: "bd" for radiobutton} -setup { .r cget -bd } -cleanup { destroy .r -} -result {4} +} -result 4 test button-1.40 {configuration option: "bd" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1165,7 +1165,7 @@ test button-1.119 {configuration option: "height" for label} -setup { .l cget -height } -cleanup { destroy .l -} -result {18} +} -result 18 test button-1.120 {configuration option: "height" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .l @@ -1184,7 +1184,7 @@ test button-1.121 {configuration option: "height" for button} -setup { .b cget -height } -cleanup { destroy .b -} -result {18} +} -result 18 test button-1.122 {configuration option: "height" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -1203,7 +1203,7 @@ test button-1.123 {configuration option: "height" for checkbutton} -setup { .c cget -height } -cleanup { destroy .c -} -result {18} +} -result 18 test button-1.124 {configuration option: "height" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -1222,7 +1222,7 @@ test button-1.125 {configuration option: "height" for radiobutton} -setup { .r cget -height } -cleanup { destroy .r -} -result {18} +} -result 18 test button-1.126 {configuration option: "height" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1566,7 +1566,7 @@ test button-1.159 {configuration option: "indicatoron" for checkbutton} -setup { .c cget -indicatoron } -cleanup { destroy .c -} -result {1} +} -result 1 test button-1.160 {configuration option: "indicatoron" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -1585,7 +1585,7 @@ test button-1.161 {configuration option: "indicatoron" for radiobutton} -setup { .r cget -indicatoron } -cleanup { destroy .r -} -result {1} +} -result 1 test button-1.162 {configuration option: "indicatoron" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -1955,7 +1955,7 @@ test button-1.199 {configuration option: "repeatdelay" for button} -setup { .b cget -repeatdelay } -cleanup { destroy .b -} -result {100} +} -result 100 test button-1.200 {configuration option: "repeatdelay" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -1975,7 +1975,7 @@ test button-1.201 {configuration option: "repeatinterval" for button} -setup { .b cget -repeatinterval } -cleanup { destroy .b -} -result {100} +} -result 100 test button-1.202 {configuration option: "repeatinterval" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -2405,7 +2405,7 @@ test button-1.243 {configuration option: "underline" for label} -setup { .l cget -underline } -cleanup { destroy .l -} -result {5} +} -result 5 test button-1.244 {configuration option: "underline" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .l @@ -2424,7 +2424,7 @@ test button-1.245 {configuration option: "underline" for button} -setup { .b cget -underline } -cleanup { destroy .b -} -result {5} +} -result 5 test button-1.246 {configuration option: "underline" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -2443,7 +2443,7 @@ test button-1.247 {configuration option: "underline" for checkbutton} -setup { .c cget -underline } -cleanup { destroy .c -} -result {5} +} -result 5 test button-1.248 {configuration option: "underline" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -2462,7 +2462,7 @@ test button-1.249 {configuration option: "underline" for radiobutton} -setup { .r cget -underline } -cleanup { destroy .r -} -result {5} +} -result 5 test button-1.250 {configuration option: "underline" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -2514,7 +2514,7 @@ test button-1.254 {configuration option: "width" for label} -setup { .l cget -width } -cleanup { destroy .l -} -result {402} +} -result 402 test button-1.255 {configuration option: "width" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .l @@ -2533,7 +2533,7 @@ test button-1.256 {configuration option: "width" for button} -setup { .b cget -width } -cleanup { destroy .b -} -result {402} +} -result 402 test button-1.257 {configuration option: "width" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -2552,7 +2552,7 @@ test button-1.258 {configuration option: "width" for checkbutton} -setup { .c cget -width } -cleanup { destroy .c -} -result {402} +} -result 402 test button-1.259 {configuration option: "width" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -2571,7 +2571,7 @@ test button-1.260 {configuration option: "width" for radiobutton} -setup { .r cget -width } -cleanup { destroy .r -} -result {402} +} -result 402 test button-1.261 {configuration option: "width" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -2591,7 +2591,7 @@ test button-1.262 {configuration option: "wraplength" for label} -setup { .l cget -wraplength } -cleanup { destroy .l -} -result {100} +} -result 100 test button-1.263 {configuration option: "wraplength" for label} -setup { label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .l @@ -2610,7 +2610,7 @@ test button-1.264 {configuration option: "wraplength" for button} -setup { .b cget -wraplength } -cleanup { destroy .b -} -result {100} +} -result 100 test button-1.265 {configuration option: "wraplength" for button} -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b @@ -2629,7 +2629,7 @@ test button-1.266 {configuration option: "wraplength" for checkbutton} -setup { .c cget -wraplength } -cleanup { destroy .c -} -result {100} +} -result 100 test button-1.267 {configuration option: "wraplength" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c @@ -2648,7 +2648,7 @@ test button-1.268 {configuration option: "wraplength" for radiobutton} -setup { .r cget -wraplength } -cleanup { destroy .r -} -result {100} +} -result 100 test button-1.269 {configuration option: "wraplength" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r @@ -2834,13 +2834,13 @@ test button-3.13 {ButtonWidgetCmd procedure, "configure" option} -body { lindex [.b configure -highlightthickness] 4 } -cleanup { destroy .b -} -result {3} +} -result 3 test button-3.14 {ButtonWidgetCmd procedure, "configure" option} -body { checkbutton .c llength [.c configure] } -cleanup { destroy .c -} -result {41} +} -result 41 test button-3.15 {ButtonWidgetCmd procedure, "configure" option} -body { button .b .b configure -gorp @@ -2889,7 +2889,7 @@ test button-3.21 {ButtonWidgetCmd procedure, "deselect" option} -body { return $checkvar } -cleanup { destroy .c -} -result {0} +} -result 0 test button-3.22 {ButtonWidgetCmd procedure, "deselect" option} -body { radiobutton .r -variable radiovar -value red set radiovar green @@ -3249,7 +3249,7 @@ test button-5.4 {ConfigureButton - variable trace} -body { ;# ex 6.2a return $y } -cleanup { destroy .c -} -result {1} +} -result 1 test button-5.5 {ConfigureButton - image handling} -constraints { testImageType @@ -3282,7 +3282,7 @@ test button-5.7 {ConfigureButton - setting selected state from variable} -body { return $y } -cleanup { destroy .c -} -result {0} +} -result 0 test button-5.8 {ConfigureButton - setting selected state from variable} -setup { unset -nocomplain x } -body { @@ -3487,7 +3487,7 @@ test button-5.25 {ConfigureButton - computing geometry} -setup { expr {$old == $new} } -cleanup { destroy .b -} -result {0} +} -result 0 test button-6.1 {ButtonEventProc procedure} -body { button .b -text "Test Button" -command { @@ -3554,7 +3554,7 @@ test button-8.3 {TkInvokeButton procedure} -setup { } -cleanup { destroy .c trace vdelete x w bogusTrace -} -result {1} +} -result 1 test button-8.4 {TkInvokeButton procedure} -setup { set x 1 } -body { @@ -3575,7 +3575,7 @@ test button-8.5 {TkInvokeButton procedure} -setup { } -cleanup { destroy .c trace vdelete x w bogusTrace -} -result {0} +} -result 0 test button-8.6 {TkInvokeButton procedure} -setup { set x 0 @@ -3665,7 +3665,7 @@ test button-9.2 {ButtonVarProc procedure} -body { return $x } -cleanup { destroy .c -} -result {1} +} -result 1 test button-9.3 {ButtonVarProc procedure} -setup { set x 1 } -body { @@ -3675,7 +3675,7 @@ test button-9.3 {ButtonVarProc procedure} -setup { return $x } -cleanup { destroy .c -} -result {1} +} -result 1 test button-9.4 {ButtonVarProc procedure} -setup { set x 0 } -body { @@ -3685,7 +3685,7 @@ test button-9.4 {ButtonVarProc procedure} -setup { return $x } -cleanup { destroy .c -} -result {0} +} -result 0 test button-9.5 {ButtonVarProc procedure} -setup { set x 1 } -body { @@ -3695,7 +3695,7 @@ test button-9.5 {ButtonVarProc procedure} -setup { return $x } -cleanup { destroy .c -} -result {0} +} -result 0 test button-9.6 {ButtonVarProc procedure} -setup { set x 0 } -body { @@ -3705,7 +3705,7 @@ test button-9.6 {ButtonVarProc procedure} -setup { return $x } -cleanup { destroy .c -} -result {1} +} -result 1 test button-9.7 {ButtonVarProc procedure} -setup { set x 1 } -body { @@ -3715,7 +3715,7 @@ test button-9.7 {ButtonVarProc procedure} -setup { return $x } -cleanup { destroy .c -} -result {1} +} -result 1 test button-9.8 {ButtonVarProc procedure, can't read variable} -setup { # This test does nothing but produce a core dump if there's a prbblem. unset -nocomplain a @@ -3751,7 +3751,7 @@ test button-10.2 {ButtonTextVarProc procedure} -setup { expr {$old == $new} } -cleanup { destroy .b -} -result {0} +} -result 0 test button-11.1 {ButtonImageProc procedure} -constraints { testImageType @@ -3780,7 +3780,7 @@ test button-12.1 {button widget vs hidden commands} -body { expr {$res1 == $res2} } -cleanup { destroy .b -} -result {1} +} -result 1 test button-13.1 {size behavior: label} -setup { label .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} diff --git a/tests/canvPs.test b/tests/canvPs.test index 126abe2..365eb1d 100644 --- a/tests/canvPs.test +++ b/tests/canvPs.test @@ -156,7 +156,7 @@ test canvPs-3.1 {test ps generation with an embedded window} -setup { destroy .c imageCleanup removeFile bar.ps -} -result {1} +} -result 1 test canvPs-3.2 {test ps generation with an embedded window not mapped} -setup { set bar [makeFile {} bar.ps] file delete $bar @@ -170,7 +170,7 @@ test canvPs-3.2 {test ps generation with an embedded window not mapped} -setup { } -cleanup { destroy .c removeFile bar.ps -} -result {1} +} -result 1 test canvPs-4.1 {test ps generation with single-point uncolored poly, bug 734498} -body { diff --git a/tests/canvText.test b/tests/canvText.test index 2bafac3..10e4fb5 100644 --- a/tests/canvText.test +++ b/tests/canvText.test @@ -250,7 +250,7 @@ test canvText-4.6 {ConfigureText procedure: adjust cursor} -setup { .c index test insert } -cleanup { .c delete test -} -result {4} +} -result 4 test canvText-5.1 {ConfigureText procedure: adjust cursor} -body { @@ -573,7 +573,7 @@ test canvText-8.8 {TextInsert procedure: inserting before cursor} -setup { .c icursor test 3 .c insert test 2 "xyz" .c index test insert -} -result {6} +} -result 6 test canvText-8.9 {TextInsert procedure: inserting after cursor} -setup { .c create text 20 20 -tag test focus .c @@ -583,7 +583,7 @@ test canvText-8.9 {TextInsert procedure: inserting after cursor} -setup { .c icursor test 3 .c insert test 4 "xyz" .c index test insert -} -result {3} +} -result 3 # Item used in 9.* tests .c create text 20 20 -tag test @@ -673,19 +673,19 @@ test canvText-9.13 {TextInsert procedure: move cursor} -body { .c icursor test 6 .c dchars test 2 4 .c index test insert -} -result {3} +} -result 3 test canvText-9.14 {TextInsert procedure: keep cursor >= first} -body { .c itemconfig test -text "abcdefghijk" .c icursor test 6 .c dchars test 2 10 .c index test insert -} -result {2} +} -result 2 test canvText-9.15 {TextInsert procedure: cursor doesn't move} -body { .c itemconfig test -text "abcdefghijk" .c icursor test 5 .c dchars test 7 9 .c index test insert -} -result {5} +} -result 5 .c delete test @@ -695,7 +695,7 @@ test canvText-10.1 {TextToPoint procedure} -body { .c index test @0,0 } -cleanup { .c delete test -} -result {0} +} -result 0 test canvText-11.1 {TextToArea procedure} -setup { @@ -834,7 +834,7 @@ test canvText-15.1 {SetTextCursor procedure} -setup { .c index test insert } -cleanup { .c delete test -} -result {3} +} -result 3 test canvText-16.1 {GetSelText procedure} -setup { .c create text 0 0 -tag test diff --git a/tests/canvas.test b/tests/canvas.test index 4e391c8..f46996f 100644 --- a/tests/canvas.test +++ b/tests/canvas.test @@ -37,14 +37,14 @@ test canvas-1.4 {configuration options: bad value for "bg"} -body { test canvas-1.5 {configuration options: good value for "bd"} -body { .c configure -bd 4 .c cget -bd -} -result {4} +} -result 4 test canvas-1.6 {configuration options: bad value for "bd"} -body { .c configure -bd badValue } -returnCodes error -result {bad screen distance "badValue"} test canvas-1.7 {configuration options: good value for "borderwidth"} -body { .c configure -borderwidth 1.3 .c cget -borderwidth -} -result {1} +} -result 1 test canvas-1.8 {configuration options: bad value for "borderwidth"} -body { .c configure -borderwidth badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -58,7 +58,7 @@ test canvas-1.10 {configuration options: bad value for "closeenough"} -body { test canvas-1.11 {configuration options: good value for "confine"} -body { .c configure -confine true .c cget -confine -} -result {1} +} -result 1 test canvas-1.12 {configuration options: bad value for "confine"} -body { .c configure -confine silly } -returnCodes error -result {expected boolean value but got "silly"} @@ -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 test canvas-1.16 {configuration options: bad value for "height"} -body { .c configure -height x42 } -returnCodes error -result {bad screen distance "x42"} @@ -93,7 +93,7 @@ test canvas-1.20 {configuration options: bad value for "highlightcolor"} -body { test canvas-1.21 {configuration options: good value for "highlightthickness"} -body { .c configure -highlightthickness 18 .c cget -highlightthickness -} -result {18} +} -result 18 test canvas-1.22 {configuration options: bad value for "highlightthickness"} -body { .c configure -highlightthickness badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -107,28 +107,28 @@ 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 test canvas-1.26 {configuration options: bad value for "insertborderwidth"} -body { .c configure -insertborderwidth 2.6x } -returnCodes error -result {bad screen distance "2.6x"} test canvas-1.27 {configuration options: good value for "insertofftime"} -body { .c configure -insertofftime 100 .c cget -insertofftime -} -result {100} +} -result 100 test canvas-1.28 {configuration options: bad value for "insertofftime"} -body { .c configure -insertofftime 3.2 } -returnCodes error -result {expected integer but got "3.2"} test canvas-1.29 {configuration options: good value for "insertontime"} -body { .c configure -insertontime 100 .c cget -insertontime -} -result {100} +} -result 100 test canvas-1.30 {configuration options: bad value for "insertontime"} -body { .c configure -insertontime 3.2 } -returnCodes error -result {expected integer but got "3.2"} test canvas-1.31 {configuration options: good value for "insertwidth"} -body { .c configure -insertwidth 1.3 .c cget -insertwidth -} -result {1} +} -result 1 test canvas-1.32 {configuration options: bad value for "insertwidth"} -body { .c configure -insertwidth 6x } -returnCodes error -result {bad screen distance "6x"} @@ -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 test canvas-1.38 {configuration options: bad value for "selectborderwidth"} -body { .c configure -selectborderwidth badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -167,7 +167,7 @@ test canvas-1.41 {configuration options: good value for "takefocus"} -body { test canvas-1.42 {configuration options: good value for "width"} -body { .c configure -width 402 .c cget -width -} -result {402} +} -result 402 test canvas-1.43 {configuration options: bad value for "width"} -body { .c configure -width xyz } -returnCodes error -result {bad screen distance "xyz"} @@ -727,7 +727,7 @@ test canvas-15.19 "basic coords check: centimeters are larger than pixels" -setu } -body { set id [.c create rect 0 0 1cm 1cm] expr {[lindex [.c coords $id] 2]>1} -} -result {1} +} -result 1 test canvas-15.20 {bug [237971ce]} -setup { destroy .c canvas .c diff --git a/tests/color.test b/tests/color.test index 1e99a7d..5b8c5d2 100644 --- a/tests/color.test +++ b/tests/color.test @@ -163,7 +163,7 @@ test color-1.5 {Color table} nonPortable { set fd [open ../xlib/rgb.txt] set result {} while {[gets $fd line] >= 0} { - if {[string index $line 0] == "!"} continue + if {[string index $line 0] == "!"} continue set rgb [c255 [winfo rgb . [lrange $line 3 end]]] if {$rgb != [lrange $line 0 2] } { append result $line\n diff --git a/tests/dialog.test b/tests/dialog.test index 78b6620..9790ef1 100644 --- a/tests/dialog.test +++ b/tests/dialog.test @@ -36,7 +36,7 @@ test dialog-2.1 {tk_dialog operation} -setup { return $res } -cleanup { destroy .d -} -result {0} +} -result 0 test dialog-2.2 {tk_dialog operation} -setup { proc HitReturn {w} { event generate $w <Enter> @@ -51,7 +51,7 @@ test dialog-2.2 {tk_dialog operation} -setup { return $res } -cleanup { destroy .d -} -result {1} +} -result 1 test dialog-2.3 {tk_dialog operation} -body { set x [after 5000 [list set tk::Priv(button) "no response"]] after 100 destroy .d @@ -60,7 +60,7 @@ test dialog-2.3 {tk_dialog operation} -body { return $res } -cleanup { destroy .b -} -result {-1} +} -result -1 cleanupTests return diff --git a/tests/entry.test b/tests/entry.test index 5f28ad8..ffa8ce2 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -3484,7 +3484,7 @@ test entry-20.7 {widget deletion with textvariable active} -body { # SF bugs 607390 and 617446 set FOO init entry .e -textvariable FOO -validate all \ - -vcmd {%W configure -bg white; format 1} + -validatecommand {%W configure -bg white; format 1} bind .e <Destroy> { set FOO hello } destroy .e winfo exists .e diff --git a/tests/font.test b/tests/font.test index ca712be..69d3b15 100644 --- a/tests/font.test +++ b/tests/font.test @@ -122,7 +122,7 @@ test font-4.3 {font command: actual: arguments} -body { } -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"} test font-4.4 {font command: actual: displayof specified, so skip to next} -body { catch {font actual xyz -displayof . -size} -} -result {0} +} -result 0 test font-4.5 {font command: actual: displayof specified, so skip to next} -body { lindex [font actual xyz -displayof .] 0 } -result {-family} @@ -537,7 +537,7 @@ test font-12.2 {UpdateDependantFonts procedure: pings the widgets} -setup { } -cleanup { destroy .t.f font delete xyz -} -result {1} +} -result 1 test font-13.1 {CreateNamedFont: new named font} -setup { @@ -1682,14 +1682,14 @@ destroy .t.f pack [label .t.f] update test font-27.1 {Tk_UnderlineTextLayout procedure: no underline chosen} -body { - .t.f config -text "foo" -under -1 + .t.f config -text "foo" -underline -1 } -result {} test font-27.2 {Tk_UnderlineTextLayout procedure: underline not visible} -body { .t.f config -text "000 00000" -wrap [expr $ax*7] -under 10 } -result {} test font-27.3 {Tk_UnderlineTextLayout procedure: underline is visible} -body { .t.f config -text "000 00000" -wrap [expr $ax*7] -under 5 - .t.f config -wrap -1 -under -1 + .t.f config -wrap -1 -underline -1 } -result {} destroy .t.f @@ -1704,7 +1704,7 @@ update test font-28.1 {Tk_PointToChar procedure: above all lines} -body { csetup "000" .t.c index text @-1,0 -} -result {0} +} -result 0 test font-28.2 {Tk_PointToChar procedure: no chars} -body { # After fixing the following bug: # @@ -1716,46 +1716,46 @@ test font-28.2 {Tk_PointToChar procedure: no chars} -body { csetup "" .t.c index text @100,100 -} -result {0} +} -result 0 test font-28.3 {Tk_PointToChar procedure: loop test} -body { csetup "000\n000\n000\n000" .t.c index text @10000,0 -} -result {3} +} -result 3 test font-28.4 {Tk_PointToChar procedure: intersect line} -body { csetup "000\n000\n000" .t.c index text @0,$ay -} -result {4} +} -result 4 test font-28.5 {Tk_PointToChar procedure: to the left of all chunks} -body { csetup "000\n000\n000" .t.c index text @-100,$ay -} -result {4} +} -result 4 test font-28.6 {Tk_PointToChar procedure: past any possible chunk} -body { csetup "000\n000\n000" .t.c index text @100000,$ay -} -result {7} +} -result 7 test font-28.7 {Tk_PointToChar procedure: which chunk on this line} -body { csetup "000\n000\t000\t000\n000" .t.c index text @[expr $ax*2],$ay -} -result {6} +} -result 6 test font-28.8 {Tk_PointToChar procedure: which chunk on this line} -body { csetup "000\n000\t000\t000\n000" .t.c index text @[expr $ax*10],$ay -} -result {10} +} -result 10 test font-28.9 {Tk_PointToChar procedure: in special chunk} -body { csetup "000\n000\t000\t000\n000" .t.c index text @[expr $ax*6],$ay -} -result {7} +} -result 7 test font-28.10 {Tk_PointToChar procedure: past all chars in chunk} -body { csetup "000 0000000" .t.c itemconfig text -width [expr $ax*5] set x [.t.c index text @[expr $ax*5],0] .t.c itemconfig text -width 0 return $x -} -result {3} +} -result 3 test font-28.11 {Tk_PointToChar procedure: below all chunks} -body { csetup "000 0000000" .t.c index text @0,1000000 -} -result {11} +} -result 11 destroy .t.c @@ -1802,7 +1802,7 @@ test font-30.1 {Tk_DistanceToTextLayout procedure: loop once} -body { return $x } -cleanup { bind all <Enter> {} -} -result {0} +} -result 0 test font-30.2 {Tk_DistanceToTextLayout procedure: loop multiple} -body { csetup "000\n000\n000" .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]} @@ -1812,7 +1812,7 @@ test font-30.2 {Tk_DistanceToTextLayout procedure: loop multiple} -body { return $x } -cleanup { bind all <Enter> {} -} -result {5} +} -result 5 test font-30.3 {Tk_DistanceToTextLayout procedure: loop to end} -body { csetup "000\n0\n000" .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]} @@ -1832,7 +1832,7 @@ test font-30.4 {Tk_DistanceToTextLayout procedure: hit a special char (tab)} -bo return $x } -cleanup { bind all <Enter> {} -} -result {3} +} -result 3 test font-30.5 {Tk_DistanceToTextLayout procedure: ignore newline} -body { csetup "000\n0\n000" .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]} @@ -1885,7 +1885,7 @@ test font-30.9 {Tk_DistanceToTextLayout procedure: inside line} -body { return $x } -cleanup { bind all <Enter> {} -} -result {0} +} -result 0 test font-30.10 {Tk_DistanceToTextLayout procedure: above line} -body { csetup "0\n000" .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]} @@ -1915,7 +1915,7 @@ test font-30.12 {Tk_DistanceToTextLayout procedure: in line} -body { return $x } -cleanup { bind all <Enter> {} -} -result {3} +} -result 3 .t.c itemconfig text -justify left test font-30.13 {Tk_DistanceToTextLayout procedure: exact hit} -body { csetup "000" @@ -1926,7 +1926,7 @@ test font-30.13 {Tk_DistanceToTextLayout procedure: exact hit} -body { return $x } -cleanup { bind all <Enter> {} -} -result {1} +} -result 1 destroy .t.c @@ -1972,7 +1972,7 @@ test font-31.7 {TkIntersectAngledTextLayout procedure: bug [514ff64dd0]} -body { # The text has been rotated 90 degrees around it's upper left corner, # so it's enough to check with a small rectangle with small negative y coords. .t.c find overlapping 5 -7 7 -5 -} -result {1} +} -result 1 destroy .t.c @@ -2183,7 +2183,7 @@ test font-37.3 {GetAttributeInfo procedure: size} -setup { font config xyz -size } -cleanup { font delete xyz -} -result {20} +} -result 20 test font-37.4 {GetAttributeInfo procedure: weight} -setup { catch {font delete xyz} set x {} @@ -2210,7 +2210,7 @@ test font-37.6 {GetAttributeInfo procedure: underline} -setup { font config xyz -underline } -cleanup { font delete xyz -} -result {1} +} -result 1 test font-37.7 {GetAttributeInfo procedure: overstrike} -setup { catch {font delete xyz} set x {} @@ -2219,7 +2219,7 @@ test font-37.7 {GetAttributeInfo procedure: overstrike} -setup { font config xyz -overstrike } -cleanup { font delete xyz -} -result {0} +} -result 0 # In tests below, one field is set to "xyz" so that font name doesn't @@ -2346,7 +2346,7 @@ test font-44.1 {TkFontGetPixels: size < 0} -constraints failsOnUbuntu -setup { font actual {times -12} -size } -cleanup { tk scaling $oldscale -} -result {24} +} -result 24 test font-44.2 {TkFontGetPoints: size >= 0} -constraints {noExceed haveTimes12Font} -setup { set oldscale [tk scaling] } -body { @@ -2354,7 +2354,7 @@ test font-44.2 {TkFontGetPoints: size >= 0} -constraints {noExceed haveTimes12Fo font actual {times 12} -size } -cleanup { tk scaling $oldscale -} -result {12} +} -result 12 test font-45.1 {TkFontGetAliasList: no match} -body { @@ -2371,7 +2371,7 @@ test font-45.3 {TkFontGetAliasList: match} -constraints {noExceed failsOnUbuntu} set res [expr {[font actual {{times new roman} 10} -family] eq \ [font actual {times 10} -family]} ] } -} -result {1} +} -result 1 test font-46.1 {font actual, with character, no option, no --} -body { @@ -2407,7 +2407,7 @@ test font-47.1 {Bug f214b8ad5b} -body { interp delete two } -result {} -test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { +test font-47.2 {Bug 3049518 - Canvas} -body { if {"MyFont" ni [font names]} { font create MyFont -family "Liberation Sans" -size 13 } @@ -2473,7 +2473,7 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body { unset -nocomplain ::results } -result {{1 2} called-.t.c {1 2} called-.t.c {1 2} called-.t.c {1 2}} -test font-47.3 {Bug 3049518, TIP 608 - Label} -body { +test font-47.3 {Bug 3049518 - Label} -body { if {"MyFont" ni [font names]} { font create MyFont -family "Liberation Sans" -size 13 } diff --git a/tests/fontchooser.test b/tests/fontchooser.test index e2e404f..8587ece 100644 --- a/tests/fontchooser.test +++ b/tests/fontchooser.test @@ -79,7 +79,7 @@ test fontchooser-1.7 {tk fontchooser: usage} -returnCodes error -body { test fontchooser-1.8 {tk fontchooser: usage} -returnCodes ok -body { tk fontchooser configure -visible -} -result {0} +} -result 0 test fontchooser-1.9 {tk fontchooser: usage} -returnCodes error -body { tk fontchooser configure -visible 1 @@ -155,7 +155,7 @@ test fontchooser-4.1 {fontchooser -font} -constraints scriptImpl -body { Click ok } expr {$::testfont ne {}} -} -result {1} +} -result 1 test fontchooser-4.2 {fontchooser -font} -constraints scriptImpl -body { start { @@ -166,7 +166,7 @@ test fontchooser-4.2 {fontchooser -font} -constraints scriptImpl -body { Click ok } expr {$::testfont ne {}} -} -result {1} +} -result 1 test fontchooser-4.3 {fontchooser -font} -constraints scriptImpl -body { start { @@ -177,7 +177,7 @@ test fontchooser-4.3 {fontchooser -font} -constraints scriptImpl -body { Click ok } expr {$::testfont ne {}} -} -result {1} +} -result 1 test fontchooser-4.4 {fontchooser -font} -constraints {scriptImpl haveTimes14BoldFont} -body { start { diff --git a/tests/frame.test b/tests/frame.test index 768b9e0..85ce6f9 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -12,9 +12,11 @@ namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands +tcltest::testConstraint x11 [expr {[tk windowingsystem] eq "x11"}] + # eatColors -- -# Creates a toplevel window and allocates enough colors in it to -# use up all the slots in the colormap. +# Creates a toplevel window and allocates enough colors in it to use up all +# the slots in an 8-bit colormap. # # Arguments: # w - Name of toplevel window to create. @@ -27,10 +29,10 @@ proc eatColors {w} { 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 + 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 @@ -38,8 +40,8 @@ proc eatColors {w} { # colorsFree -- # -# Returns 1 if there appear to be free colormap entries in a window, -# 0 otherwise. +# Returns 1 if there appear to be free colormap entries in a window, 0 +# otherwise. # # Arguments: # w - Name of window in which to check. @@ -47,12 +49,34 @@ proc eatColors {w} { # to see if there are colormap entries free. 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) + lassign [winfo rgb $w [format "#%02x%02x%02x" $red $green $blue]] r g b + expr {($r/256 == $red) && ($g/256 == $green) && ($b/256 == $blue)} } +# uniq -- +# +# Returns the unique items of a list in the order they first appear. +# +# Arguments: +# list - The list to uniq-ify. +proc uniq {list} { + set d {} + foreach item $list { + dict set d $item {} + } + return [dict keys $d] +} +# optnames -- +# +# Returns the option names out of a list of option details. +# +# Arguments: +# options - The option detail list. +proc optnames {options} { + lsort [lmap desc $options {lindex $desc 0}] +} + test frame-1.1 {frame configuration options} -setup { deleteWindows } -body { @@ -66,10 +90,9 @@ test frame-1.2 {frame configuration options} -setup { } -body { frame .f -class NewFrame .f configure -class Different -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {can't modify -class option after widget is created} - +} -result {can't modify -class option after widget is created} test frame-1.3 {frame configuration options} -setup { deleteWindows } -body { @@ -83,10 +106,9 @@ test frame-1.4 {frame configuration options} -setup { } -body { frame .f -colormap new .f configure -colormap . -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {can't modify -colormap option after widget is created} - +} -result {can't modify -colormap option after widget is created} test frame-1.5 {frame configuration options} -setup { deleteWindows } -body { @@ -100,10 +122,9 @@ test frame-1.6 {frame configuration options} -setup { } -body { frame .f -visual default .f configure -visual best -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {can't modify -visual option after widget is created} - +} -result {can't modify -visual option after widget is created} test frame-1.7 {frame configuration options} -setup { deleteWindows } -body { @@ -138,9 +159,9 @@ test frame-1.11 {frame configuration options} -setup { } -body { frame .f .f configure -container 1 -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {can't modify -container option after widget is created} +} -result {can't modify -container option after widget is created} test frame-1.12 {frame configuration options} -setup { deleteWindows } -body { @@ -153,10 +174,10 @@ test frame-1.12 {frame configuration options} -setup { } } eval frame .g $opts - destroy .f .g } -cleanup { + destroy .f .g deleteWindows -} -result {} +} -result .g destroy .f frame .f @@ -165,7 +186,7 @@ test frame-1.13 {frame configuration options} -body { lindex [.f configure -background] 4 } -cleanup { .f configure -background [lindex [.f configure -background] 3] -} -result {#ff0000} +} -result "#ff0000" test frame-1.14 {frame configuration options} -body { .f configure -background non-existent } -returnCodes error -result {unknown color name "non-existent"} @@ -174,7 +195,7 @@ test frame-1.15 {frame configuration options} -body { lindex [.f configure -bd] 4 } -cleanup { .f configure -bd [lindex [.f configure -bd] 3] -} -result {4} +} -result 4 test frame-1.16 {frame configuration options} -body { .f configure -bd badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -183,7 +204,7 @@ test frame-1.17 {frame configuration options} -body { lindex [.f configure -bg] 4 } -cleanup { .f configure -bg [lindex [.f configure -bg] 3] -} -result {#00ff00} +} -result "#00ff00" test frame-1.18 {frame configuration options} -body { .f configure -bg non-existent } -returnCodes error -result {unknown color name "non-existent"} @@ -192,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 test frame-1.20 {frame configuration options} -body { .f configure -borderwidth badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -210,7 +231,7 @@ test frame-1.23 {frame configuration options} -body { lindex [.f configure -height] 4 } -cleanup { .f configure -height [lindex [.f configure -height] 3] -} -result {100} +} -result 100 test frame-1.24 {frame configuration options} -body { .f configure -height not_a_number } -returnCodes error -result {bad screen distance "not_a_number"} @@ -219,7 +240,7 @@ test frame-1.25 {frame configuration options} -body { lindex [.f configure -highlightbackground] 4 } -cleanup { .f configure -highlightbackground [lindex [.f configure -highlightbackground] 3] -} -result {#112233} +} -result "#112233" test frame-1.26 {frame configuration options} -body { .f configure -highlightbackground ugly } -returnCodes error -result {unknown color name "ugly"} @@ -228,7 +249,7 @@ test frame-1.27 {frame configuration options} -body { lindex [.f configure -highlightcolor] 4 } -cleanup { .f configure -highlightcolor [lindex [.f configure -highlightcolor] 3] -} -result {#123456} +} -result "#123456" test frame-1.28 {frame configuration options} -body { .f configure -highlightcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} @@ -237,7 +258,7 @@ test frame-1.29 {frame configuration options} -body { lindex [.f configure -highlightthickness] 4 } -cleanup { .f configure -highlightthickness [lindex [.f configure -highlightthickness] 3] -} -result {6} +} -result 6 test frame-1.30 {frame configuration options} -body { .f configure -highlightthickness badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -246,7 +267,7 @@ test frame-1.31 {frame configuration options} -body { lindex [.f configure -padx] 4 } -cleanup { .f configure -padx [lindex [.f configure -padx] 3] -} -result {3} +} -result 3 test frame-1.32 {frame configuration options} -body { .f configure -padx badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -255,7 +276,7 @@ test frame-1.33 {frame configuration options} -body { lindex [.f configure -pady] 4 } -cleanup { .f configure -pady [lindex [.f configure -pady] 3] -} -result {4} +} -result 4 test frame-1.34 {frame configuration options} -body { .f configure -pady badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -265,9 +286,9 @@ test frame-1.35 {frame configuration options} -body { } -cleanup { .f configure -relief [lindex [.f configure -relief] 3] } -result {ridge} -test frame-1.36 {frame configuration options} -body { +test frame-1.36 {frame configuration options} -returnCodes error -body { .f configure -relief badValue -} -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} +} -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} test frame-1.37 {frame configuration options} -body { .f configure -takefocus {any string} lindex [.f configure -takefocus] 4 @@ -279,13 +300,12 @@ test frame-1.38 {frame configuration options} -body { lindex [.f configure -width] 4 } -cleanup { .f configure -width [lindex [.f configure -width] 3] -} -result {32} +} -result 32 test frame-1.39 {frame configuration options} -body { .f configure -width badValue } -returnCodes error -result {bad screen distance "badValue"} destroy .f - test frame-2.1 {toplevel configuration options} -setup { deleteWindows } -body { @@ -301,10 +321,9 @@ test frame-2.2 {toplevel configuration options} -setup { toplevel .t -width 200 -height 100 -class NewClass wm geometry .t +0+0 .t configure -class Another -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {can't modify -class option after widget is created} - +} -result {can't modify -class option after widget is created} test frame-2.3 {toplevel configuration options} -setup { deleteWindows } -body { @@ -320,23 +339,21 @@ test frame-2.4 {toplevel configuration options} -setup { toplevel .t -width 200 -height 100 -colormap new wm geometry .t +0+0 .t configure -colormap . -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {can't modify -colormap option after widget is created} - +} -result {can't modify -colormap option after widget is created} test frame-2.5 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 wm geometry .t +0+0 .t configure -container 1 -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {can't modify -container option after widget is created} +} -result {can't modify -container option after widget is created} test frame-2.6 {toplevel configuration options} -setup { deleteWindows } -body { - catch {destroy .t} toplevel .t -width 200 -height 100 wm geometry .t +0+0 catch {.t configure -container 1} @@ -344,7 +361,6 @@ test frame-2.6 {toplevel configuration options} -setup { } -cleanup { deleteWindows } -result {-container container Container 0 0} - test frame-2.7 {toplevel configuration options} -setup { deleteWindows } -body { @@ -352,26 +368,18 @@ test frame-2.7 {toplevel configuration options} -setup { } -cleanup { deleteWindows } -returnCodes error -result {bad window path name "bogus"} - - -test frame-2.8 {toplevel configuration options} -constraints { - win -} -setup { +test frame-2.8 {toplevel configuration options} -constraints win -setup { deleteWindows } -body { - catch {destroy .t} toplevel .t -width 200 -height 100 wm geometry .t +0+0 .t configure -use 0x44022 } -cleanup { deleteWindows } -returnCodes error -result {window "0x44022" doesn't exist} -test frame-2.9 {toplevel configuration options} -constraints { - win -} -setup { +test frame-2.9 {toplevel configuration options} -constraints win -setup { deleteWindows } -body { - catch {destroy .t} toplevel .t -width 200 -height 100 wm geometry .t +0+0 catch {.t configure -use 0x44022} @@ -379,25 +387,18 @@ test frame-2.9 {toplevel configuration options} -constraints { } -cleanup { deleteWindows } -result {-use use Use {} {}} - -test frame-2.10 {toplevel configuration options} -constraints { - nonwin -} -setup { +test frame-2.10 {toplevel configuration options} -constraints nonwin -setup { deleteWindows } -body { - catch {destroy .t} toplevel .t -width 200 -height 100 wm geometry .t +0+0 .t configure -use 0x44022 } -cleanup { deleteWindows } -returnCodes error -result {can't modify -use option after widget is created} -test frame-2.11 {toplevel configuration options} -constraints { - nonwin -} -setup { +test frame-2.11 {toplevel configuration options} -constraints nonwin -setup { deleteWindows } -body { - catch {destroy .t} toplevel .t -width 200 -height 100 wm geometry .t +0+0 catch {.t configure -use 0x44022} @@ -405,11 +406,9 @@ test frame-2.11 {toplevel configuration options} -constraints { } -cleanup { deleteWindows } -result {-use use Use {} {}} - test frame-2.12 {toplevel configuration options} -setup { deleteWindows } -body { - catch {destroy .t} toplevel .t -width 200 -height 100 -visual default wm geometry .t +0+0 .t configure -visual @@ -419,40 +418,41 @@ test frame-2.12 {toplevel configuration options} -setup { test frame-2.13 {toplevel configuration options} -setup { deleteWindows } -body { - catch {destroy .t} toplevel .t -width 200 -height 100 -visual default wm geometry .t +0+0 .t configure -visual best -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {can't modify -visual option after widget is created} - +} -result {can't modify -visual option after widget is created} test frame-2.14 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -visual who_knows? -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {unknown or ambiguous visual name "who_knows?": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default} -test frame-2.15 {toplevel configuration options} -constraints haveDISPLAY -setup { +} -result {unknown or ambiguous visual name "who_knows?": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default} +set expectedScreen "" +if {[tcltest::testConstraint haveDISPLAY]} { + set expectedScreen [list -screen screen Screen {} $env(DISPLAY)] +} +test frame-2.15 {toplevel configuration options} -constraints {x11 haveDISPLAY} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -screen $env(DISPLAY) wm geometry .t +0+0 - string compare [.t configure -screen] "-screen screen Screen {} $env(DISPLAY)" + .t configure -screen } -cleanup { deleteWindows -} -result {0} -test frame-2.16 {toplevel configuration options} -constraints haveDISPLAY -setup { +} -result $expectedScreen +test frame-2.16 {toplevel configuration options} -constraints {x11 haveDISPLAY} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -screen $env(DISPLAY) wm geometry .t +0+0 .t configure -screen another -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {can't modify -screen option after widget is created} - +} -result {can't modify -screen option after widget is created} test frame-2.17 {toplevel configuration options} -setup { deleteWindows } -body { @@ -466,9 +466,9 @@ test frame-2.18 {toplevel configuration options} -setup { toplevel .t -container 1 -width 300 -height 120 wm geometry .t +0+0 toplevel .x -container 1 -use [winfo id .t] -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {windows cannot have both the -use and the -container option set} +} -result {windows cannot have both the -use and the -container option set} test frame-2.19 {toplevel configuration options} -setup { deleteWindows set opts {} @@ -481,11 +481,10 @@ test frame-2.19 {toplevel configuration options} -setup { } } eval toplevel .g $opts - destroy .f .g } -cleanup { + destroy .f .g deleteWindows -} -result {} - +} -result .g destroy .t toplevel .t -width 300 -height 150 @@ -494,28 +493,28 @@ update test frame-2.20 {toplevel configuration options} -body { .t configure -background #ff0000 lindex [.t configure -background] 4 -} -result {#ff0000} +} -result "#ff0000" test frame-2.21 {toplevel configuration options} -body { .t configure -background non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-2.22 {toplevel configuration options} -body { .t configure -bd 4 lindex [.t configure -bd] 4 -} -result {4} +} -result 4 test frame-2.23 {toplevel configuration options} -body { .t configure -bd badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-2.24 {toplevel configuration options} -body { .t configure -bg #00ff00 lindex [.t configure -bg] 4 -} -result {#00ff00} +} -result "#00ff00" test frame-2.25 {toplevel configuration options} -body { .t configure -bg non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-2.26 {toplevel configuration options} -body { .t configure -borderwidth 1.3 lindex [.t configure -borderwidth] 4 -} -result {1} +} -result 1 test frame-2.27 {toplevel configuration options} -body { .t configure -borderwidth badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -529,35 +528,35 @@ test frame-2.29 {toplevel configuration options} -body { test frame-2.30 {toplevel configuration options} -body { .t configure -height 100 lindex [.t configure -height] 4 -} -result {100} +} -result 100 test frame-2.31 {toplevel configuration options} -body { .t configure -height not_a_number } -returnCodes error -result {bad screen distance "not_a_number"} test frame-2.32 {toplevel configuration options} -body { .t configure -highlightcolor #123456 lindex [.t configure -highlightcolor] 4 -} -result {#123456} +} -result "#123456" test frame-2.33 {toplevel configuration options} -body { .t configure -highlightcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-2.34 {toplevel configuration options} -body { .t configure -highlightthickness 3 lindex [.t configure -highlightthickness] 4 -} -result {3} +} -result 3 test frame-2.35 {toplevel configuration options} -body { .t configure -highlightthickness badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-2.36 {toplevel configuration options} -body { .t configure -padx 3 lindex [.t configure -padx] 4 -} -result {3} +} -result 3 test frame-2.37 {toplevel configuration options} -body { .t configure -padx badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-2.38 {toplevel configuration options} -body { .t configure -pady 4 lindex [.t configure -pady] 4 -} -result {4} +} -result 4 test frame-2.39 {toplevel configuration options} -body { .t configure -pady badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -565,22 +564,21 @@ test frame-2.40 {toplevel configuration options} -body { .t configure -relief ridge lindex [.t configure -relief] 4 } -result {ridge} -test frame-2.41 {toplevel configuration options} -body { +test frame-2.41 {toplevel configuration options} -returnCodes error -body { .t configure -relief badValue -} -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} +} -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} test frame-2.42 {toplevel configuration options} -body { .t configure -width 32 lindex [.t configure -width] 4 -} -result {32} +} -result 32 test frame-2.43 {toplevel configuration options} -body { .t configure -width badValue } -returnCodes error -result {bad screen distance "badValue"} destroy .t - -test frame-3.1 {TkCreateFrame procedure} -body { +test frame-3.1 {TkCreateFrame procedure} -returnCodes error -body { frame -} -returnCodes error -result {wrong # args: should be "frame pathName ?-option value ...?"} +} -result {wrong # args: should be "frame pathName ?-option value ...?"} test frame-3.2 {TkCreateFrame procedure} -setup { deleteWindows frame .f @@ -610,7 +608,6 @@ test frame-3.4 {TkCreateFrame procedure} -setup { } -cleanup { deleteWindows } -result {350 black 90} - # Be sure that the -class, -colormap, and -visual options are processed # before configuring the widget. test frame-3.5 {TkCreateFrame procedure} -setup { @@ -679,42 +676,40 @@ test frame-3.10 {TkCreateFrame procedure, -use option} -constraints { destroy .t option clear } -result {0 0 140 300} - -# The tests below require specific display characteristics (i.e. that -# they are run on a pseudocolor display of depth 8). Even so, they -# are non-portable: some machines don't seem to ever run out of -# colors. +# The tests below require specific display characteristics (i.e. that they are +# run on a pseudocolor display of depth 8). Even so, they are non-portable: +# some machines don't seem to ever run out of colors. if {[testConstraint defaultPseudocolor8]} { eatColors .t1 } test frame-3.11 {TkCreateFrame procedure} -constraints { - defaultPseudocolor8 nonPortable + defaultPseudocolor8 nonPortable } -setup { - deleteWindows + destroy .t } -body { toplevel .t -width 300 -height 200 -bg #475601 wm geometry .t +0+0 update colorsFree .t } -cleanup { - deleteWindows -} -result {0} + destroy .t +} -result 0 test frame-3.12 {TkCreateFrame procedure} -constraints { - defaultPseudocolor8 nonPortable + defaultPseudocolor8 nonPortable } -setup { - deleteWindows + destroy .t } -body { toplevel .t -width 300 -height 200 -bg #475601 -colormap new wm geometry .t +0+0 update colorsFree .t } -cleanup { - deleteWindows -} -result {1} + destroy .t +} -result 1 test frame-3.13 {TkCreateFrame procedure} -constraints { - defaultPseudocolor8 nonPortable + defaultPseudocolor8 nonPortable } -setup { - deleteWindows + destroy .t } -body { option add *t.class Toplevel2 option add *Toplevel2.colormap new @@ -724,12 +719,12 @@ test frame-3.13 {TkCreateFrame procedure} -constraints { option clear colorsFree .t } -cleanup { - deleteWindows -} -result {1} + destroy .t +} -result 1 test frame-3.14 {TkCreateFrame procedure} -constraints { - defaultPseudocolor8 nonPortable + defaultPseudocolor8 nonPortable } -setup { - deleteWindows + destroy .t } -body { option add *t.class Toplevel3 option add *Toplevel3.Colormap new @@ -739,12 +734,12 @@ test frame-3.14 {TkCreateFrame procedure} -constraints { option clear colorsFree .t } -cleanup { - deleteWindows -} -result {1} + destroy .t +} -result 1 test frame-3.15 {TkCreateFrame procedure, -use and -colormap} -constraints { defaultPseudocolor8 unix nonPortable } -setup { - deleteWindows + destroy .t } -body { toplevel .t -container 1 -width 300 -height 120 wm geometry .t +0+0 @@ -755,21 +750,21 @@ test frame-3.15 {TkCreateFrame procedure, -use and -colormap} -constraints { destroy .t } -result {0 1} test frame-3.16 {TkCreateFrame procedure} -constraints { - defaultPseudocolor8 nonPortable + defaultPseudocolor8 nonPortable } -setup { - deleteWindows + destroy .t } -body { toplevel .t -width 300 -height 200 -bg #475601 -visual default wm geometry .t +0+0 update colorsFree .t } -cleanup { - deleteWindows -} -result {0} + destroy .t +} -result 0 test frame-3.17 {TkCreateFrame procedure} -constraints { - defaultPseudocolor8 nonPortable + defaultPseudocolor8 nonPortable } -setup { - deleteWindows + destroy .t } -body { toplevel .t -width 300 -height 200 -bg #475601 -visual default \ -colormap new @@ -777,24 +772,24 @@ test frame-3.17 {TkCreateFrame procedure} -constraints { update colorsFree .t } -cleanup { - deleteWindows -} -result {1} + destroy .t +} -result 1 test frame-3.18 {TkCreateFrame procedure} -constraints { - defaultPseudocolor8 haveGrayscale8 nonPortable + defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { - deleteWindows + destroy .t } -body { toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343 wm geometry .t +0+0 update colorsFree .t 131 131 131 } -cleanup { - deleteWindows -} -result {1} + destroy .t +} -result 1 test frame-3.19 {TkCreateFrame procedure} -constraints { - defaultPseudocolor8 haveGrayscale8 nonPortable + defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { - deleteWindows + destroy .t } -body { option add *t.class T4 option add *T4.visual {grayscale 8} @@ -804,14 +799,13 @@ test frame-3.19 {TkCreateFrame procedure} -constraints { option clear list [colorsFree .t 131 131 131] [lindex [.t configure -visual] 4] } -cleanup { - deleteWindows + destroy .t } -result {1 {grayscale 8}} test frame-3.20 {TkCreateFrame procedure} -constraints { - defaultPseudocolor8 haveGrayscale8 nonPortable + defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { - deleteWindows + destroy .t } -body { - set x ok option add *t.class T5 option add *T5.Visual {grayscale 8} toplevel .t -width 300 -height 200 -bg #434343 @@ -820,25 +814,23 @@ test frame-3.20 {TkCreateFrame procedure} -constraints { option clear list [colorsFree .t 131 131 131] [lindex [.t configure -visual] 4] } -cleanup { - deleteWindows + destroy .t } -result {1 {grayscale 8}} test frame-3.21 {TkCreateFrame procedure} -constraints { - defaultPseudocolor8 haveGrayscale8 nonPortable + defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { - deleteWindows + destroy .t } -body { - set x ok toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343 wm geometry .t +0+0 update colorsFree .t 131 131 131 } -cleanup { - deleteWindows -} -result {1} + destroy .t +} -result 1 if {[testConstraint defaultPseudocolor8]} { destroy .t1 } - test frame-3.22 {TkCreateFrame procedure, default dimensions} -setup { deleteWindows } -body { @@ -865,7 +857,6 @@ test frame-3.24 {TkCreateFrame procedure} -setup { wm geometry .t +0+0 } -returnCodes error -result {unknown option "-bogus"} - test frame-4.1 {TkCreateFrame procedure} -setup { deleteWindows } -body { @@ -880,7 +871,6 @@ test frame-4.2 {TkCreateFrame procedure} -setup { deleteWindows } -result {.f 1} - frame .f -highlightcolor black test frame-5.1 {FrameWidgetCommand procedure} -body { .f @@ -908,10 +898,9 @@ test frame-5.7 {FrameWidgetCommand procedure, cget option} -setup { } -cleanup { destroy .t } -returnCodes ok -match glob -result * - test frame-5.8 {FrameWidgetCommand procedure, configure option} -body { - llength [.f configure] -} -result {18} + optnames [.f configure] +} -result {-background -bd -bg -borderwidth -class -colormap -container -cursor -height -highlightbackground -highlightcolor -highlightthickness -padx -pady -relief -takefocus -visual -width} test frame-5.9 {FrameWidgetCommand procedure, configure option} -body { .f configure -gorp } -returnCodes error -result {unknown option "-gorp"} @@ -925,8 +914,8 @@ test frame-5.12 {FrameWidgetCommand procedure} -body { .f swizzle } -returnCodes error -result {bad option "swizzle": must be cget or configure} test frame-5.13 {FrameWidgetCommand procedure, configure option} -body { - llength [. configure] -} -result {21} + optnames [. configure] +} -result {-background -bd -bg -borderwidth -class -colormap -container -cursor -height -highlightbackground -highlightcolor -highlightthickness -menu -padx -pady -relief -screen -takefocus -use -visual -width} destroy .f test frame-6.1 {ConfigureFrame procedure} -setup { @@ -1006,7 +995,6 @@ test frame-8.2 {FrameCmdDeletedProc procedure} -setup { # This one fails with the dash-patch!!!! Still don't know why :-( # #test frame-8.3 {FrameCmdDeletedProc procedure} -setup { -# eval destroy [winfo children .] # deleteWindows #} -body { # toplevel .f1 -menu .m @@ -1017,7 +1005,6 @@ test frame-8.2 {FrameCmdDeletedProc procedure} -setup { # update # list [info command .f*] [winfo children .] #} -cleanup { -# eval destroy [winfo children .] # deleteWindows #} -result {{} .m} @@ -1040,7 +1027,7 @@ test frame-9.2 {MapFrame procedure} -setup { destroy .t update winfo exists .t -} -result {0} +} -result 0 test frame-9.3 {MapFrame procedure, window deleted while mapping} -setup { deleteWindows } -body { @@ -1056,21 +1043,16 @@ test frame-9.3 {MapFrame procedure, window deleted while mapping} -setup { winfo exists .t } -cleanup { deleteWindows -} -result {0} - +} -result 0 test frame-10.1 {frame widget vs hidden commands} -setup { deleteWindows } -body { - set l [interp hidden] frame .t interp hide {} .t destroy .t - set res1 [list [winfo children .] [interp hidden]] - set res2 [list {} $l] - expr {$res1 eq $res2} -} -result 1 - + list [winfo children .] [lsort [interp hidden]] +} -result [list {} [lsort [interp hidden]]] test frame-11.1 {TkInstallFrameMenu} -setup { deleteWindows @@ -1085,8 +1067,8 @@ test frame-11.1 {TkInstallFrameMenu} -setup { } -result {.t} test frame-11.2 {TkInstallFrameMenu - frame renamed} -setup { deleteWindows -} -body { catch {rename foo {}} +} -body { menu .m1 .m1 add cascade -menu .m1.system menu .m1.system -tearoff 0 @@ -1097,7 +1079,6 @@ test frame-11.2 {TkInstallFrameMenu - frame renamed} -setup { deleteWindows } -result {} - test frame-12.1 {FrameWorldChanged procedure} -setup { deleteWindows } -body { @@ -1117,13 +1098,10 @@ test frame-12.2 {FrameWorldChanged procedure} -setup { set font {helvetica 12} labelframe .f -highlightthickness 1 -bd 3 -padx 1 -pady 2 -font $font \ -text "Mupp" - set fh [expr {[font metrics $font -linespace] + 2 - 3}] - set fw [expr {[font measure $font "Mupp"] + 2 - 3}] - if {$fw < 0} {set fw 0} - if {$fh < 0} {set fh 0} + 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 @@ -1138,9 +1116,10 @@ test frame-12.2 {FrameWorldChanged procedure} -setup { 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}] + lappend result [expr { + [winfo x .f.f] == $expx && [winfo y .f.f] == $expy && + [winfo width .f.f] == $expw && [winfo height .f.f] == $exph + }] } return $result } -cleanup { @@ -1166,11 +1145,10 @@ test frame-12.3 {FrameWorldChanged procedure} -setup { } -cleanup { deleteWindows font delete myfont -} -result {0} - +} -result 0 test frame-13.1 {labelframe configuration options} -setup { - deleteWindows + deleteWindows } -body { labelframe .f -class NewFrame .f configure -class @@ -1182,9 +1160,9 @@ test frame-13.2 {labelframe configuration options} -setup { } -body { labelframe .f -class NewFrame .f configure -class Different -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {can't modify -class option after widget is created} +} -result {can't modify -class option after widget is created} test frame-13.3 {labelframe configuration options} -setup { deleteWindows } -body { @@ -1233,10 +1211,9 @@ test frame-13.9 {labelframe configuration options} -setup { } -body { labelframe .f .f configure -container 1 -} -cleanup { +} -returnCodes error -cleanup { deleteWindows -} -returnCodes error -result {can't modify -container option after widget is created} - +} -result {can't modify -container option after widget is created} destroy .f labelframe .f test frame-13.10 {labelframe configuration options} -body { @@ -1244,36 +1221,36 @@ test frame-13.10 {labelframe configuration options} -body { lindex [.f configure -background] 4 } -cleanup { .f configure -background [lindex [.f configure -background] 3] -} -result {#ff0000} +} -result "#ff0000" test frame-13.11 {labelframe configuration options} -body { - .f configure -background non-existent + .f configure -background non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-13.12 {labelframe configuration options} -body { .f configure -bd 4 lindex [.f configure -bd] 4 } -cleanup { .f configure -bd [lindex [.f configure -bd] 3] -} -result {4} +} -result 4 test frame-13.13 {labelframe configuration options} -body { - .f configure -bd badValue + .f configure -bd badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-13.14 {labelframe configuration options} -body { .f configure -bg #00ff00 lindex [.f configure -bg] 4 } -cleanup { .f configure -bg [lindex [.f configure -bg] 3] -} -result {#00ff00} +} -result "#00ff00" test frame-13.15 {labelframe configuration options} -body { - .f configure -bg non-existent + .f configure -bg non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-13.16 {labelframe configuration options} -body { .f configure -borderwidth 1.3 lindex [.f configure -borderwidth] 4 } -cleanup { .f configure -borderwidth [lindex [.f configure -borderwidth] 3] -} -result {1} +} -result 1 test frame-13.17 {labelframe configuration options} -body { - .f configure -borderwidth badValue + .f configure -borderwidth badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-13.18 {labelframe configuration options} -body { .f configure -cursor arrow @@ -1282,16 +1259,16 @@ test frame-13.18 {labelframe configuration options} -body { .f configure -cursor [lindex [.f configure -cursor] 3] } -result {arrow} test frame-13.19 {labelframe configuration options} -body { - .f configure -cursor badValue + .f configure -cursor badValue } -returnCodes error -result {bad cursor spec "badValue"} test frame-13.20 {labelframe configuration options} -body { .f configure -fg #0000ff lindex [.f configure -fg] 4 } -cleanup { .f configure -fg [lindex [.f configure -fg] 3] -} -result {#0000ff} +} -result "#0000ff" test frame-13.21 {labelframe configuration options} -body { - .f configure -fg non-existent + .f configure -fg non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-13.22 {labelframe configuration options} -body { .f configure -font {courier 8} @@ -1304,45 +1281,45 @@ test frame-13.23 {labelframe configuration options} -body { lindex [.f configure -foreground] 4 } -cleanup { .f configure -foreground [lindex [.f configure -foreground] 3] -} -result {#ff0000} +} -result "#ff0000" test frame-13.24 {labelframe configuration options} -body { - .f configure -foreground non-existent + .f configure -foreground non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-13.25 {labelframe configuration options} -body { .f configure -height 100 lindex [.f configure -height] 4 } -cleanup { .f configure -height [lindex [.f configure -height] 3] -} -result {100} +} -result 100 test frame-13.26 {labelframe configuration options} -body { - .f configure -height not_a_number + .f configure -height not_a_number } -returnCodes error -result {bad screen distance "not_a_number"} test frame-13.27 {labelframe configuration options} -body { .f configure -highlightbackground #112233 lindex [.f configure -highlightbackground] 4 } -cleanup { .f configure -highlightbackground [lindex [.f configure -highlightbackground] 3] -} -result {#112233} +} -result "#112233" test frame-13.28 {labelframe configuration options} -body { - .f configure -highlightbackground ugly + .f configure -highlightbackground ugly } -returnCodes error -result {unknown color name "ugly"} test frame-13.29 {labelframe configuration options} -body { .f configure -highlightcolor #123456 lindex [.f configure -highlightcolor] 4 } -cleanup { .f configure -highlightcolor [lindex [.f configure -highlightcolor] 3] -} -result {#123456} +} -result "#123456" test frame-13.30 {labelframe configuration options} -body { - .f configure -highlightcolor non-existent + .f configure -highlightcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-13.31 {labelframe configuration options} -body { .f configure -highlightthickness 6 lindex [.f configure -highlightthickness] 4 } -cleanup { .f configure -highlightthickness [lindex [.f configure -highlightthickness] 3] -} -result {6} +} -result 6 test frame-13.32 {labelframe configuration options} -body { - .f configure -highlightthickness badValue + .f configure -highlightthickness badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-13.33 {labelframe configuration options} -body { .f configure -labelanchor se @@ -1350,26 +1327,26 @@ test frame-13.33 {labelframe configuration options} -body { } -cleanup { .f configure -labelanchor [lindex [.f configure -labelanchor] 3] } -result {se} -test frame-13.34 {labelframe configuration options} -body { - .f configure -labelanchor badValue -} -returnCodes error -result {bad labelanchor "badValue": must be e, en, es, n, ne, nw, s, se, sw, w, wn, or ws} +test frame-13.34 {labelframe configuration options} -returnCodes error -body { + .f configure -labelanchor badValue +} -result {bad labelanchor "badValue": must be e, en, es, n, ne, nw, s, se, sw, w, wn, or ws} test frame-13.35 {labelframe configuration options} -body { .f configure -padx 3 lindex [.f configure -padx] 4 } -cleanup { .f configure -padx [lindex [.f configure -padx] 3] -} -result {3} +} -result 3 test frame-13.36 {labelframe configuration options} -body { - .f configure -padx badValue + .f configure -padx badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-13.37 {labelframe configuration options} -body { .f configure -pady 4 lindex [.f configure -pady] 4 } -cleanup { .f configure -pady [lindex [.f configure -pady] 3] -} -result {4} +} -result 4 test frame-13.38 {labelframe configuration options} -body { - .f configure -pady badValue + .f configure -pady badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-13.39 {labelframe configuration options} -body { .f configure -relief ridge @@ -1377,9 +1354,9 @@ test frame-13.39 {labelframe configuration options} -body { } -cleanup { .f configure -relief [lindex [.f configure -relief] 3] } -result {ridge} -test frame-13.40 {labelframe configuration options} -body { - .f configure -relief badValue -} -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} +test frame-13.40 {labelframe configuration options} -returnCodes error -body { + .f configure -relief badValue +} -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} test frame-13.41 {labelframe configuration options} -body { .f configure -takefocus {any string} lindex [.f configure -takefocus] 4 @@ -1397,13 +1374,12 @@ test frame-13.43 {labelframe configuration options} -body { lindex [.f configure -width] 4 } -cleanup { .f configure -width [lindex [.f configure -width] 3] -} -result {32} +} -result 32 test frame-13.44 {labelframe configuration options} -body { - .f configure -width badValue + .f configure -width badValue } -returnCodes error -result {bad screen distance "badValue"} destroy .f - test frame-14.1 {labelframe labelwidget option} -setup { deleteWindows } -body { @@ -1497,10 +1473,10 @@ test frame-14.5 {labelframe labelwidget option} -setup { test frame-14.6 {labelframe labelwidget option} -setup { deleteWindows } -body { - # Destroying a labelframe with a child label caused a crash - # when not handling mapping of the label correctly. - # This test does not test anything directly, it's just ment - # to catch if the same mistake is made again. + # Destroying a labelframe with a child label caused a crash when not + # handling mapping of the label correctly. + # This test does not test anything directly, it's just ment to catch if + # the same mistake is made again. labelframe .f pack .f label .f.l -text Mupp @@ -1510,13 +1486,13 @@ test frame-14.6 {labelframe labelwidget option} -setup { deleteWindows } -result {} deleteWindows -rename eatColors {} -rename colorsFree {} +apply {cmds {foreach cmd $cmds {rename $cmd {}}}} { + eatColors colorsFree uniq optnames +} -# cleanup cleanupTests return - - - +# Local Variables: +# mode: tcl +# End: diff --git a/tests/geometry.test b/tests/geometry.test index c10a119..d3bb0c5 100644 --- a/tests/geometry.test +++ b/tests/geometry.test @@ -282,7 +282,7 @@ test geometry-4.10 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup { winfo ismapped .t.quit } -cleanup { destroy .t -} -result {1} +} -result 1 # cleanup diff --git a/tests/grid.test b/tests/grid.test index a668b45..4a03cff 100644 --- a/tests/grid.test +++ b/tests/grid.test @@ -387,12 +387,12 @@ test grid-7.2 {propagate} -body { grid propagate . } -cleanup { grid_reset 7.2 -} -result {1} +} -result 1 test grid-7.3 {propagate} -body { grid propagate . 0;grid propagate . } -cleanup { grid_reset 7.3 -} -result {0} +} -result 0 test grid-7.4 {propagate} -body { grid propagate .x } -cleanup { @@ -594,7 +594,7 @@ test grid-10.5 {column/row configure} -body { grid columnconfigure . 265 -weight } -cleanup { grid_reset 10.5 -} -result {0} +} -result 0 test grid-10.6 {column/row configure} -body { grid columnconfigure . 0 } -cleanup { @@ -620,7 +620,7 @@ test grid-10.10 {column/row configure} -body { grid columnconfigure . 0 -minsize } -cleanup { grid_reset 10.10 -} -result {10} +} -result 10 test grid-10.11 {column/row configure} -body { grid columnconfigure . 0 -weight bad } -cleanup { @@ -636,7 +636,7 @@ test grid-10.13 {column/row configure} -body { grid columnconfigure . 0 -weight } -cleanup { grid_reset 10.13 -} -result {3} +} -result 3 test grid-10.14 {column/row configure} -body { grid columnconfigure . 0 -pad foo } -cleanup { @@ -652,7 +652,7 @@ test grid-10.16 {column/row configure} -body { grid columnconfigure . 0 -pad } -cleanup { grid_reset 10.16 -} -result {3} +} -result 3 test grid-10.17 {column/row configure} -body { frame .f set a "" @@ -1823,7 +1823,6 @@ test grid-17.1 {forget and pending idle handlers} -body { set result ok } -result ok - test grid-18.1 {test respect for internalborder} -body { toplevel .pack wm geometry .pack 200x200 @@ -2038,7 +2037,7 @@ test grid-23 {grid configure -in leaked from previous container window - bug pack forget .f update winfo ismapped .t ; # must return 1 -} {1} +} 1 grid_reset 23 # cleanup diff --git a/tests/image.test b/tests/image.test index 1f0aad2..f116827 100644 --- a/tests/image.test +++ b/tests/image.test @@ -50,7 +50,7 @@ test image-1.6 {Tk_ImageCmd procedure, "create" option} -constraints { expr {$second-$first} } -cleanup { imageCleanup -} -result {1} +} -result 1 test image-1.7 {Tk_ImageCmd procedure, "create" option} -constraints { testImageType diff --git a/tests/imgBmap.test b/tests/imgBmap.test index bb54012..8f5b5fb 100644 --- a/tests/imgBmap.test +++ b/tests/imgBmap.test @@ -366,7 +366,7 @@ test imageBmap-7.5 {ImgBmapCmd procedure, "cget" option} -body { } -returnCodes error -result {unknown option "-stupid"} test imageBmap-7.6 {ImgBmapCmd procedure} -body { llength [i1 configure] -} -result {6} +} -result 6 test imageBmap-7.7 {ImgBmapCmd procedure} -body { i1 co -foreground #001122 i1 configure -foreground diff --git a/tests/imgPNG.test b/tests/imgPNG.test index 4900e9c..465d8ea 100644 --- a/tests/imgPNG.test +++ b/tests/imgPNG.test @@ -1116,6 +1116,7 @@ test imgPNG-3.1 {reading image with unknown ancillary chunk - bug [1c659ef0f1]} } -result {0} } + namespace delete png imageFinish cleanupTests diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index a890fd7..21690d1 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -976,7 +976,7 @@ test imgPhoto-10.2 {Tk_ImgPhotoPutBlock, same source and dest img} -constraints string equal [photo1 data] [photo2 data] } -cleanup { imageCleanup -} -result {1} +} -result 1 test imgPhoto-10.3 {Tk_ImgPhotoPutBlock, same source and dest img} -constraints { hasTeapotPhoto } -setup { @@ -990,7 +990,7 @@ test imgPhoto-10.3 {Tk_ImgPhotoPutBlock, same source and dest img} -constraints string equal [photo1 data] [photo2 data] } -cleanup { imageCleanup -} -result {1} +} -result 1 test imgPhoto-10.4 {Tk_ImgPhotoPutBlock, empty image} -setup { imageCleanup } -body { @@ -1033,7 +1033,7 @@ test imgPhoto-12.2 {Tk_ImgPhotoPutZoomedBlock, same source and dest img} -constr string equal [photo1 data] [photo2 data] } -cleanup { imageCleanup -} -result {1} +} -result 1 test imgPhoto-12.3 {Tk_ImgPhotoPutZoomedBlock, same source and dest img} -setup { imageCleanup } -body { @@ -1045,7 +1045,7 @@ test imgPhoto-12.3 {Tk_ImgPhotoPutZoomedBlock, same source and dest img} -setup string equal [photo1 data] [photo2 data] } -cleanup { imageCleanup -} -result {1} +} -result 1 test imgPhoto-12.4 {Tk_ImgPhotoPutZoomedBlock, empty image} -setup { imageCleanup } -body { diff --git a/tests/listbox.test b/tests/listbox.test index 42dc327..6119b2e 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -2132,7 +2132,7 @@ test listbox-10.19 {GetListboxIndex procedure} -setup { .l index -1 } -cleanup { destroy .l -} -result -1 +} -result -1 test listbox-10.20 {GetListboxIndex procedure} -setup { destroy .l } -body { diff --git a/tests/message.test b/tests/message.test index 2ca6921..02c04f4 100644 --- a/tests/message.test +++ b/tests/message.test @@ -41,7 +41,7 @@ test message-1.3 {configuration option: "aspect"} -setup { .m cget -aspect } -cleanup { destroy .m -} -result {3} +} -result 3 test message-1.4 {configuration option: "aspect"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .m @@ -81,7 +81,7 @@ test message-1.7 {configuration option: "bd"} -setup { .m cget -bd } -cleanup { destroy .m -} -result {4} +} -result 4 test message-1.8 {configuration option: "bd"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .m @@ -121,7 +121,7 @@ test message-1.11 {configuration option: "borderwidth"} -setup { .m cget -borderwidth } -cleanup { destroy .m -} -result {1} +} -result 1 test message-1.12 {configuration option: "borderwidth"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .m @@ -261,7 +261,7 @@ test message-1.25 {configuration option: "highlightthickness"} -setup { .m cget -highlightthickness } -cleanup { destroy .m -} -result {2} +} -result 2 test message-1.26 {configuration option: "highlightthickness"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .m @@ -383,7 +383,7 @@ test message-1.37 {configuration option: "width"} -setup { .m cget -width } -cleanup { destroy .m -} -result {2} +} -result 2 test message-1.38 {configuration option: "width"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .m @@ -452,7 +452,7 @@ test message-3.5 {MessageWidgetObjCmd procedure, "configure"} -setup { llength [.m configure] } -cleanup { destroy .m -} -result {21} +} -result 21 test message-3.6 {MessageWidgetObjCmd procedure, "configure"} -setup { message .m } -body { @@ -468,7 +468,7 @@ test message-3.7 {MessageWidgetObjCmd procedure, "configure"} -setup { lindex [.m configure -bd] 4 } -cleanup { destroy .m -} -result {4} +} -result 4 test message-4.1 {Bug [5d991b822e]} { # Want this not to segfault, or write to variable with empty name diff --git a/tests/pack.test b/tests/pack.test index 53a0870..fb59fd9 100644 --- a/tests/pack.test +++ b/tests/pack.test @@ -233,7 +233,6 @@ test pack-2.21 {x padding and filling} -setup { update list [winfo geometry .pack.a] [winfo geometry .pack.b] } -result {280x40+5+0 300x160+0+40} - test pack-2.22 {x padding and filling} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { @@ -253,7 +252,6 @@ test pack-2.23 {x padding and filling} -setup { expr {$res1 eq $res2} } -result 1 - test pack-3.1 {y padding and filling} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { @@ -422,7 +420,6 @@ test pack-3.21 {y padding and filling} -setup { update list [winfo geometry .pack.a] [winfo geometry .pack.b] } -result {20x50+140+1 300x130+0+70} - test pack-3.22 {y padding and filling} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { @@ -442,7 +439,6 @@ test pack-3.23 {y padding and filling} -setup { expr {$res1 eq $res2} } -result 1 - test pack-4.1 {anchors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { @@ -507,7 +503,6 @@ test pack-4.9 {anchors} -setup { winfo geometry .pack.a } -result {30x70+135+65} - # Repeat above tests, but with a frame that isn't at (0,0), so that # we can be sure that the frame offset is being added in correctly. @@ -593,7 +588,6 @@ test pack-5.9 {more anchors} -setup { winfo geometry .pack.b } -result {60x60+160+90} - test pack-6.1 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { @@ -699,7 +693,6 @@ test pack-6.11 {-expand option} -setup { list [winfo geometry .pack.a] [winfo geometry .pack.b] \ [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 @@ -734,7 +727,6 @@ test pack-6.13 {-expand option} -setup { destroy .pack2 } -result {38x42+181+45 38x42+181+178 38x42+181+312} - wm geometry .pack {} test pack-7.1 {requesting size for parent} -setup { pack forget .pack.a .pack.b .pack.c .pack.d @@ -793,7 +785,6 @@ test pack-7.7 {requesting size for parent} -setup { list [winfo reqwidth .pack] [winfo reqheight .pack] } -result {100 110} - # For the tests below, create a couple of "pad" windows to shrink # the available space for the remaining windows. The tests have to # be done this way rather than shrinking the whole window, because @@ -874,7 +865,6 @@ test pack-8.9 {insufficient space} -body { } -result {20x40+0+20 1 50x30+100+25 1 80x80+20+0 1} pack forget .pack.right .pack.bottom - test pack-9.1 {window ordering} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { @@ -947,7 +937,6 @@ test pack-9.10 {window ordering} -setup { pack content .pack } -result {.pack.a .pack.c .pack.d .pack.b} - test pack-10.1 {retaining/clearing configuration state} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { @@ -1135,7 +1124,6 @@ test pack-11.19 {info option} -setup { lindex $i [expr [lsearch -exact $i -side]+1] } -result right - test pack-12.1 {command options and errors} -body { pack } -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} @@ -1377,7 +1365,6 @@ test pack-12.46 {command options and errors} -setup { pack lousy .pack } -returnCodes error -result {bad option "lousy": must be configure, content, forget, info, propagate, or slaves} - test pack-13.1 {window deletion} -setup { pack forget .pack.a .pack.b .pack.c .pack.d .pack.right .pack.bottom } -body { @@ -1391,7 +1378,6 @@ test pack-13.1 {window deletion} -setup { [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 { pack forget .pack.a .pack.b .pack.c .pack.d .pack.right .pack.bottom } -body { @@ -1517,7 +1503,6 @@ test pack-15.5 {managing geometry with -in option} -setup { destroy .pack.f1 .pack.f2 } -result {50x16+25+22 1 50x16+25+22 0} - test pack-16.1 {geometry manager name} -setup { pack forget .pack.a .pack.b .pack.c .pack.d set result {} @@ -1529,7 +1514,6 @@ test pack-16.1 {geometry manager name} -setup { lappend result [winfo manager .pack.a] } -result {{} pack {}} - test pack-17.1 {PackLostContentProc procedure} -setup { pack forget .pack.a .pack.b .pack.c .pack.d } -body { @@ -1640,7 +1624,6 @@ test pack-18.2 {unmap content when container unmapped} -constraints {failsOnUbun lappend result [winfo ismapped .pack.b] } -result {1 0 100 30 0 1} - test pack-19.1 {test respect for internalborder} -setup { catch {pack forget {*}[pack content .pack]} destroy .pack.l .pack.lf @@ -1683,5 +1666,6 @@ test pack-19.2 {test support for minreqsize} -setup { cleanupTests return - - +# Local Variables: +# mode: tcl +# End: diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 29e0ced..192bff4 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4562,7 +4562,7 @@ test panedwindow-22.2 {PanedWindowReqProc, react to pane geometry changes} -setu expr {[lindex $result 1] - [lindex $result 0]} } -cleanup { deleteWindows -} -result {10} +} -result 10 test panedwindow-23.1 {ConfigurePanes, can't add panedwindow to itself} -setup { @@ -5461,7 +5461,7 @@ test panedwindow-27.2 {destroy the window cleanly on rename [Bug #616589]} -setu winfo exists .p } -cleanup { deleteWindows -} -result {0} +} -result 0 test panedwindow-28.1 {resizing width} -setup { diff --git a/tests/place.test b/tests/place.test index d9c496c..5927f2f 100644 --- a/tests/place.test +++ b/tests/place.test @@ -65,7 +65,7 @@ test place-2.2 {ConfigureContent procedure, -height option} -setup { place .t.f2 -in .t.f -height 40 update winfo height .t.f2 -} -result {40} +} -result 40 test place-2.3 {ConfigureContent procedure, -height option} -setup { place forget .t.f2 } -body { @@ -74,7 +74,7 @@ test place-2.3 {ConfigureContent procedure, -height option} -setup { place .t.f2 -height {} update winfo height .t.f2 -} -result {60} +} -result 60 test place-3.1 {ConfigureContent procedure, -relheight option} -body { @@ -86,7 +86,7 @@ test place-3.2 {ConfigureContent procedure, -relheight option} -setup { place .t.f2 -in .t.f -relheight .5 update winfo height .t.f2 -} -result {40} +} -result 40 test place-3.3 {ConfigureContent procedure, -relheight option} -setup { place forget .t.f2 } -body { @@ -95,7 +95,7 @@ test place-3.3 {ConfigureContent procedure, -relheight option} -setup { place .t.f2 -relheight {} update winfo height .t.f2 -} -result {60} +} -result 60 test place-4.1 {ConfigureContent procedure, bad -in options} -setup { @@ -151,7 +151,7 @@ test place-5.2 {ConfigureContent procedure, -relwidth option} -setup { place .t.f2 -in .t.f -relwidth .5 update winfo width .t.f2 -} -result {75} +} -result 75 test place-5.3 {ConfigureContent procedure, -relwidth option} -setup { place forget .t.f2 } -body { @@ -160,7 +160,7 @@ test place-5.3 {ConfigureContent procedure, -relwidth option} -setup { place .t.f2 -relwidth {} update winfo width .t.f2 -} -result {30} +} -result 30 test place-6.1 {ConfigureContent procedure, -width option} -body { place .t.f2 -width abcd @@ -171,7 +171,7 @@ test place-6.2 {ConfigureContent procedure, -width option} -setup { place .t.f2 -in .t.f -width 100 update winfo width .t.f2 -} -result {100} +} -result 100 test place-6.3 {ConfigureContent procedure, -width option} -setup { place forget .t.f2 } -body { @@ -180,7 +180,7 @@ test place-6.3 {ConfigureContent procedure, -width option} -setup { place .t.f2 -width {} update winfo width .t.f2 -} -result {30} +} -result 30 test place-7.1 {ReconfigurePlacement procedure, computing position} -setup { @@ -507,16 +507,17 @@ test place-14.1 {memory leak testing} -constraints memory -setup { frame .f frame .f.f stress { - place .f.f -x [expr {1 + 1}] -y [expr {2 + 2}] - place forget .f.f + place .f.f -x [expr {1 + 1}] -y [expr {2 + 2}] + place forget .f.f } { - place .f.f -x [expr {1 + 1}] -y [expr {2 + 2}] - pack .f.f + place .f.f -x [expr {1 + 1}] -y [expr {2 + 2}] + pack .f.f + update; # Needed because of TIP #518, handle <<NoManagedChild>> event. } { - place .f.f -x [expr {1 + 1}] -y [expr {2 + 2}] - destroy .f - frame .f - frame .f.f + place .f.f -x [expr {1 + 1}] -y [expr {2 + 2}] + destroy .f + frame .f + frame .f.f } } -cleanup { destroy .f diff --git a/tests/safePrimarySelection.test b/tests/safePrimarySelection.test index 8475ce3..30d8fe1 100644 --- a/tests/safePrimarySelection.test +++ b/tests/safePrimarySelection.test @@ -281,7 +281,7 @@ test safePrimarySelection-1.6 {parent interpreter, spinbox spun, no existing sel } -cleanup { destroy {*}[winfo children .] ::_test_tmp::clearPrimarySelection -} -result {2} +} -result 2 test safePrimarySelection-1.7 {parent interpreter, spinbox spun/selected/spun, no existing selection} -setup { catch {interp delete child2} @@ -293,7 +293,7 @@ test safePrimarySelection-1.7 {parent interpreter, spinbox spun/selected/spun, n } -cleanup { destroy {*}[winfo children .] ::_test_tmp::clearPrimarySelection -} -result {3} +} -result 3 test safePrimarySelection-1.8 {parent interpreter, ttk::spinbox as entry, no existing selection} -setup { catch {interp delete child2} @@ -317,7 +317,7 @@ test safePrimarySelection-1.9 {parent interpreter, ttk::spinbox spun, no existin } -cleanup { destroy {*}[winfo children .] ::_test_tmp::clearPrimarySelection -} -result {2} +} -result 2 test safePrimarySelection-1.10 {parent interpreter, ttk::spinbox spun/selected/spun, no existing selection} -setup { catch {interp delete child2} @@ -329,7 +329,7 @@ test safePrimarySelection-1.10 {parent interpreter, ttk::spinbox spun/selected/s } -cleanup { destroy {*}[winfo children .] ::_test_tmp::clearPrimarySelection -} -result {3} +} -result 3 test safePrimarySelection-2.1 {child interpreter, text, no existing selection} -setup { catch {interp delete child2} @@ -431,7 +431,7 @@ test safePrimarySelection-2.6 {child interpreter, spinbox spun, no existing sele destroy {*}[winfo children .] unset int2 ::_test_tmp::clearPrimarySelection -} -result {2} +} -result 2 test safePrimarySelection-2.7 {child interpreter, spinbox spun/selected/spun, no existing selection} -setup { catch {interp delete child2} @@ -448,7 +448,7 @@ test safePrimarySelection-2.7 {child interpreter, spinbox spun/selected/spun, no destroy {*}[winfo children .] unset int2 ::_test_tmp::clearPrimarySelection -} -result {3} +} -result 3 test safePrimarySelection-2.8 {child interpreter, ttk::spinbox as entry, no existing selection} -setup { catch {interp delete child2} @@ -482,7 +482,7 @@ test safePrimarySelection-2.9 {child interpreter, ttk::spinbox spun, no existing destroy {*}[winfo children .] unset int2 ::_test_tmp::clearPrimarySelection -} -result {2} +} -result 2 test safePrimarySelection-2.10 {child interpreter, ttk::spinbox spun/selected/spun, no existing selection} -setup { catch {interp delete child2} @@ -499,7 +499,7 @@ test safePrimarySelection-2.10 {child interpreter, ttk::spinbox spun/selected/sp destroy {*}[winfo children .] unset int2 ::_test_tmp::clearPrimarySelection -} -result {3} +} -result 3 test safePrimarySelection-3.1 {IMPORTANT, safe interpreter, text, no existing selection} -setup { catch {interp delete child2} @@ -781,7 +781,7 @@ test safePrimarySelection-4.6 {parent interpreter, spinbox spun, existing select } -cleanup { destroy {*}[winfo children .] ::_test_tmp::clearPrimarySelection -} -result {2} +} -result 2 test safePrimarySelection-4.7 {parent interpreter, spinbox spun/selected/spun, existing selection} -setup { catch {interp delete child2} @@ -793,7 +793,7 @@ test safePrimarySelection-4.7 {parent interpreter, spinbox spun/selected/spun, e } -cleanup { destroy {*}[winfo children .] ::_test_tmp::clearPrimarySelection -} -result {3} +} -result 3 test safePrimarySelection-4.8 {parent interpreter, ttk::spinbox as entry, existing selection} -setup { catch {interp delete child2} @@ -817,7 +817,7 @@ test safePrimarySelection-4.9 {parent interpreter, ttk::spinbox spun, existing s } -cleanup { destroy {*}[winfo children .] ::_test_tmp::clearPrimarySelection -} -result {2} +} -result 2 test safePrimarySelection-4.10 {parent interpreter, ttk::spinbox spun/selected/spun, existing selection} -setup { catch {interp delete child2} @@ -829,7 +829,7 @@ test safePrimarySelection-4.10 {parent interpreter, ttk::spinbox spun/selected/s } -cleanup { destroy {*}[winfo children .] ::_test_tmp::clearPrimarySelection -} -result {3} +} -result 3 test safePrimarySelection-5.1 {child interpreter, text, existing selection} -setup { catch {interp delete child2} @@ -931,7 +931,7 @@ test safePrimarySelection-5.6 {child interpreter, spinbox spun, existing selecti destroy {*}[winfo children .] unset int2 ::_test_tmp::clearPrimarySelection -} -result {2} +} -result 2 test safePrimarySelection-5.7 {child interpreter, spinbox spun/selected/spun, existing selection} -setup { catch {interp delete child2} @@ -948,7 +948,7 @@ test safePrimarySelection-5.7 {child interpreter, spinbox spun/selected/spun, ex destroy {*}[winfo children .] unset int2 ::_test_tmp::clearPrimarySelection -} -result {3} +} -result 3 test safePrimarySelection-5.8 {child interpreter, ttk::spinbox as entry, existing selection} -setup { catch {interp delete child2} @@ -982,7 +982,7 @@ test safePrimarySelection-5.9 {child interpreter, ttk::spinbox spun, existing se destroy {*}[winfo children .] unset int2 ::_test_tmp::clearPrimarySelection -} -result {2} +} -result 2 test safePrimarySelection-5.10 {child interpreter, ttk::spinbox spun/selected/spun, existing selection} -setup { catch {interp delete child2} @@ -999,7 +999,7 @@ test safePrimarySelection-5.10 {child interpreter, ttk::spinbox spun/selected/sp destroy {*}[winfo children .] unset int2 ::_test_tmp::clearPrimarySelection -} -result {3} +} -result 3 test safePrimarySelection-6.1 {IMPORTANT, safe interpreter, text, existing selection} -setup { catch {interp delete child2} diff --git a/tests/scale.test b/tests/scale.test index 157f1fe..a7b0963 100644 --- a/tests/scale.test +++ b/tests/scale.test @@ -46,7 +46,7 @@ test scale-1.5 {configuration options} -body { .s cget -bd } -cleanup { .s configure -bd [lindex [.s configure -bd] 3] -} -result {4} +} -result 4 test scale-1.6 {configuration options} -body { .s configure -bd badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -73,7 +73,7 @@ test scale-1.11 {configuration options} -body { .s cget -borderwidth } -cleanup { .s configure -borderwidth [lindex [.s configure -borderwidth] 3] -} -result {1} +} -result 1 test scale-1.12 {configuration options} -body { .s configure -borderwidth badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -97,7 +97,7 @@ test scale-1.17 {configuration options} -body { .s cget -digits } -cleanup { .s configure -digits [lindex [.s configure -digits] 3] -} -result {5} +} -result 5 test scale-1.18 {configuration options} -body { .s configure -digits badValue } -returnCodes error -result {expected integer but got "badValue"} @@ -157,7 +157,7 @@ test scale-1.31 {configuration options} -body { .s cget -highlightthickness } -cleanup { .s configure -highlightthickness [lindex [.s configure -highlightthickness] 3] -} -result {2} +} -result 2 test scale-1.32 {configuration options} -body { .s configure -highlightthickness badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -172,7 +172,7 @@ test scale-1.35 {configuration options} -body { .s cget -length } -cleanup { .s configure -length [lindex [.s configure -length] 3] -} -result {130} +} -result 130 test scale-1.36 {configuration options} -body { .s configure -length badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -205,7 +205,7 @@ test scale-1.43 {configuration options} -body { .s cget -repeatdelay } -cleanup { .s configure -repeatdelay [lindex [.s configure -repeatdelay] 3] -} -result {14} +} -result 14 test scale-1.44 {configuration options} -body { .s configure -repeatdelay bogus } -returnCodes error -result {expected integer but got "bogus"} @@ -214,7 +214,7 @@ test scale-1.45 {configuration options} -body { .s cget -repeatinterval } -cleanup { .s configure -repeatinterval [lindex [.s configure -repeatinterval] 3] -} -result {14} +} -result 14 test scale-1.46 {configuration options} -body { .s configure -repeatinterval bogus } -returnCodes error -result {expected integer but got "bogus"} @@ -232,7 +232,7 @@ test scale-1.49 {configuration options} -body { .s cget -showvalue } -cleanup { .s configure -showvalue [lindex [.s configure -showvalue] 3] -} -result {0} +} -result 0 test scale-1.50 {configuration options} -body { .s configure -showvalue badValue } -returnCodes error -result {expected boolean value but got "badValue"} @@ -241,7 +241,7 @@ test scale-1.51 {configuration options} -body { .s cget -sliderlength } -cleanup { .s configure -sliderlength [lindex [.s configure -sliderlength] 3] -} -result {86} +} -result 86 test scale-1.52 {configuration options} -body { .s configure -sliderlength badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -313,7 +313,7 @@ test scale-1.69 {configuration options} -body { .s cget -width } -cleanup { .s configure -width [lindex [.s configure -width] 3] -} -result {32} +} -result 32 test scale-1.70 {configuration options} -body { .s configure -width badValue } -returnCodes error -result {bad screen distance "badValue"} @@ -359,7 +359,7 @@ test scale-3.4 {ScaleWidgetCmd procedure, cget option} -body { test scale-3.5 {ScaleWidgetCmd procedure, cget option} -body { .s configure -highlightthickness 2 .s cget -highlightthickness -} -result {2} +} -result 2 test scale-3.6 {ScaleWidgetCmd procedure, configure option} -body { list [llength [.s configure]] [lindex [.s configure] 6] } -result {33 {-command command Command {} {}}} @@ -466,7 +466,7 @@ test scale-3.28 {ScaleWidgetCmd procedure, set option} -body { .s set 181 .s configure -state normal .s get -} -result {118} +} -result 118 test scale-3.29 {ScaleWidgetCmd procedure} -body { .s dumb } -returnCodes error -result {bad option "dumb": must be cget, configure, coords, get, identify, or set} @@ -588,27 +588,27 @@ test scale-6.1 {ComputeFormat procedure} -body { .s configure -from 10 -to 100 -resolution 10 .s set 49.3 .s get -} -result {50} +} -result 50 test scale-6.2 {ComputeFormat procedure} -body { .s configure -from 100 -to 1000 -resolution 100 .s set 493 .s get -} -result {500} +} -result 500 test scale-6.3 {ComputeFormat procedure} -body { .s configure -from 1000 -to 10000 -resolution 1000 .s set 4930 .s get -} -result {5000} +} -result 5000 test scale-6.4 {ComputeFormat procedure} -body { .s configure -from 10000 -to 100000 -resolution 10000 .s set 49000 .s get -} -result {50000} +} -result 50000 test scale-6.5 {ComputeFormat procedure} -body { .s configure -from 100000 -to 1000000 -resolution 100000 .s set 493000 .s get -} -result {500000} +} -result 500000 test scale-6.6 {ComputeFormat procedure} -constraints { nonPortable } -body { @@ -617,7 +617,7 @@ test scale-6.6 {ComputeFormat procedure} -constraints { .s configure -from 1000000 -to 10000000 -resolution 1000000 .s set 4930000 .s get -} -result {5000000} +} -result 5000000 test scale-6.7 {ComputeFormat procedure} -body { .s configure -from 1000000000 -to 10000000000 -resolution 1000000000 .s set 4930000000 @@ -652,7 +652,7 @@ test scale-6.13 {ComputeFormat procedure} -body { .s configure -from .000001 -to .00001 -resolution .000001 .s set .000006 expr {[.s get] == 6.0e-06} -} -result {1} +} -result 1 test scale-6.14 {ComputeFormat procedure} -body { .s configure -to .00001 -from .0001 -resolution .00001 .s set .00006 @@ -662,17 +662,17 @@ test scale-6.15 {ComputeFormat procedure} -body { .s configure -to .000001 -from .00001 -resolution .000001 .s set .000006 expr {[.s get] == 6.0e-06} -} -result {1} +} -result 1 test scale-6.16 {ComputeFormat procedure} -body { .s configure -from .00001 -to .0001 -resolution .00001 -digits 1 .s set .00006 expr {[.s get] == 6e-05} -} -result {1} +} -result 1 test scale-6.17 {ComputeFormat procedure} -body { .s configure -from 10000000 -to 100000000 -resolution 10000000 -digits 3 .s set 49300000 .s get -} -result {50000000} +} -result 50000000 test scale-6.18 {ComputeFormat procedure} -body { .s configure -length 200 -from 0 -to 10 -resolution 0 -digits 0 .s set .111111111 @@ -1135,26 +1135,26 @@ test scale-14.5 {RoundValueToResolution procedure} -body { -orient horizontal -resolution 4.0 update .s get 84 152 -} -result {-28} +} -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 update .s get 86 152 -} -result {-24} +} -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 update .s get 84 152 -} -result {-72} +} -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 update .s get 86 152 -} -result {-76} +} -result -76 test scale-14.9 {RoundValueToResolution procedure} -body { .s configure -from 0 -to 2.25 -sliderlength 10 -length 114 -bd 2 \ @@ -1205,7 +1205,7 @@ test scale-14a.1 {RoundValueToResolution, RoundIntervalToResolution procedures} .s get 200 0 } -cleanup { destroy .s -} -result {5} +} -result 5 test scale-14a.2 {RoundValueToResolution, RoundIntervalToResolution procedures} -setup { pack [scale .s -orient horizontal] update @@ -1226,7 +1226,7 @@ test scale-15.1 {ScaleVarProc procedure} -setup { scale .s -from 0 -to -200 -variable y -orient horizontal -length 150 pack .s return $y -} -result {-130} +} -result -130 test scale-15.2 {ScaleVarProc procedure} -setup { deleteWindows } -body { @@ -1235,7 +1235,7 @@ test scale-15.2 {ScaleVarProc procedure} -setup { pack .s set y -87 .s get -} -result {-87} +} -result -87 test scale-15.3 {ScaleVarProc procedure} -setup { deleteWindows } -body { @@ -1256,7 +1256,7 @@ test scale-15.4 {ScaleVarProc procedure} -setup { .s get } -cleanup { deleteWindows -} -result {-130} +} -result -130 test scale-15.5 {ScaleVarProc procedure} -setup { deleteWindows } -body { @@ -1344,7 +1344,7 @@ test scale-17.1 {bug fix 1786} -setup { return $x } -cleanup { deleteWindows -} -result {100} +} -result 100 test scale-18.1 {DestroyScale, -cursor option [Bug: 3897]} -setup { diff --git a/tests/scrollbar.test b/tests/scrollbar.test index f529699..fe10d5b 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -197,7 +197,7 @@ test scrollbar-3.14.1 {ScrollbarWidgetCmd procedure, "cget" option} emptyTest { destroy .s2 test scrollbar-3.15 {ScrollbarWidgetCmd procedure, "configure" option} { llength [.s configure] -} {20} +} 20 test scrollbar-3.16 {ScrollbarWidgetCmd procedure, "configure" option} { list [catch {.s configure -bad} msg] $msg } {1 {unknown option "-bad"}} @@ -230,7 +230,7 @@ test scrollbar-3.24 {ScrollbarWidgetCmd procedure, "delta" option} { } {1 {expected integer but got "xxyz"}} test scrollbar-3.25 {ScrollbarWidgetCmd procedure, "delta" option} { format {%.6g} [.s delta 20 0] -} {0} +} 0 test scrollbar-3.26 {ScrollbarWidgetCmd procedure, "delta" option} { format {%.6g} [.s delta 0 20] } [format %.6g [expr {20.0/([getTroughSize .s]-1)}]] @@ -262,10 +262,10 @@ test scrollbar-3.32 {ScrollbarWidgetCmd procedure, "fraction" option} { } {1 {expected integer but got "bogus"}} test scrollbar-3.33 {ScrollbarWidgetCmd procedure, "fraction" option} { format {%.6g} [.s fraction 0 0] -} {0} +} 0 test scrollbar-3.34 {ScrollbarWidgetCmd procedure, "fraction" option} { format {%.6g} [.s fraction 0 1000] -} {1} +} 1 test scrollbar-3.35 {ScrollbarWidgetCmd procedure, "fraction" option} { format {%.6g} [.s fraction 4 21] } [format %.6g [expr {(21.0 - ([winfo height .s] - [getTroughSize .s])/2.0) \ @@ -276,7 +276,7 @@ test scrollbar-3.36 {ScrollbarWidgetCmd procedure, "fraction" option} { /([getTroughSize .s] - 1)}]] test scrollbar-3.37 {ScrollbarWidgetCmd procedure, "fraction" option} {testmetrics} { format {%.6g} [.s fraction 4 [expr {200 - [testmetrics cyvscroll .s]}]] -} {1} +} 1 test scrollbar-3.38 {ScrollbarWidgetCmd procedure, "fraction" option} { format {%.6g} [.s fraction 4 178] } [format %.6g [expr {(178.0 - ([winfo height .s] - [getTroughSize .s])/2.0) \ @@ -311,7 +311,7 @@ if {[testConstraint testmetrics]} { update test scrollbar-3.42 {ScrollbarWidgetCmd procedure, "fraction" option} { format {%.6g} [.t.s fraction 100 0] -} {0} +} 0 destroy .t test scrollbar-3.43 {ScrollbarWidgetCmd procedure, "get" option} { list [catch {.s get a} msg] $msg diff --git a/tests/send.test b/tests/send.test index ccf3eab..7828713 100644 --- a/tests/send.test +++ b/tests/send.test @@ -403,14 +403,14 @@ test send-10.4 {SendEventProc procedure, leading nulls, bogus commands} {secures set a null update set a -} {44} +} 44 test send-10.5 {SendEventProc procedure, extraneous command options} {secureserver testsend} { testsend prop comm Comm \ "c\n-n tktest\n-x miscellanous\n-y who knows?\n-s set a new\n" set a null update set a -} {new} +} new test send-10.6 {SendEventProc procedure, unknown interpreter} {secureserver testsend} { testsend prop [winfo id .f] Comm {} testsend prop comm Comm \ diff --git a/tests/spinbox.test b/tests/spinbox.test index 0f67b37..147ee52 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -714,7 +714,7 @@ test spinbox-1.61 {configuration option: "repeatinterval"} -setup { .e cget -repeatinterval } -cleanup { destroy .e -} -result {-500} +} -result -500 test spinbox-1.62 {configuration option: "repeatinterval" for spinbox} -setup { spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken @@ -916,14 +916,14 @@ test spinbox-1.79 {configuration option: "values" for spinbox} -setup { destroy .e } -returnCodes {error} -result {list element in braces followed by "list" instead of space} -test spinbox-1.80 {configuration option: "vcmd"} -setup { +test spinbox-1.80 {configuration option: "validatecommand"} -setup { spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { - .e configure -vcmd "a command" - .e cget -vcmd + .e configure -validatecommand "a command" + .e cget -validatecommand } -cleanup { destroy .e } -result {a command} diff --git a/tests/text.test b/tests/text.test index 43810cd..b238886 100644 --- a/tests/text.test +++ b/tests/text.test @@ -28,7 +28,7 @@ test text-1.1 {configuration option: "autoseparators"} -setup { .t cget -autoseparators } -cleanup { destroy .t -} -result {1} +} -result 1 test text-1.1b {configuration option: "autoseparators", default} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -37,7 +37,7 @@ test text-1.1b {configuration option: "autoseparators", default} -setup { .t cget -autoseparators } -cleanup { destroy .t -} -result {1} +} -result 1 test text-1.2 {configuration option: "autoseparators"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -75,7 +75,7 @@ test text-1.5 {configuration option: "bd"} -setup { .t cget -bd } -cleanup { destroy .t -} -result {4} +} -result 4 test text-1.6 {configuration option: "bd"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -113,7 +113,7 @@ test text-1.9 {configuration option: "blockcursor"} -setup { .t cget -blockcursor } -cleanup { destroy .t -} -result {0} +} -result 0 test text-1.10 {configuration option: "blockcursor"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -132,7 +132,7 @@ test text-1.11 {configuration option: "borderwidth"} -setup { .t cget -borderwidth } -cleanup { destroy .t -} -result {7} +} -result 7 test text-1.12 {configuration option: "borderwidth"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -170,7 +170,7 @@ test text-1.15 {configuration option: "exportselection"} -setup { .t cget -exportselection } -cleanup { destroy .t -} -result {0} +} -result 0 test text-1.16 {configuration option: "exportselection"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -246,7 +246,7 @@ test text-1.23 {configuration option: "height"} -setup { .t cget -height } -cleanup { destroy .t -} -result {5} +} -result 5 test text-1.24 {configuration option: "height"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -303,7 +303,7 @@ test text-1.29 {configuration option: "highlightthickness"} -setup { .t cget -highlightthickness } -cleanup { destroy .t -} -result {0} +} -result 0 test text-1.30 {configuration option: "highlightthickness"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -360,7 +360,7 @@ test text-1.35 {configuration option: "insertborderwidth"} -setup { .t cget -insertborderwidth } -cleanup { destroy .t -} -result {45} +} -result 45 test text-1.36 {configuration option: "insertborderwidth"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -379,7 +379,7 @@ test text-1.37 {configuration option: "insertofftime"} -setup { .t cget -insertofftime } -cleanup { destroy .t -} -result {100} +} -result 100 test text-1.38 {configuration option: "insertofftime"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -398,7 +398,7 @@ test text-1.39 {configuration option: "insertontime"} -setup { .t cget -insertontime } -cleanup { destroy .t -} -result {47} +} -result 47 test text-1.40 {configuration option: "insertontime"} -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 test text-1.42 {configuration option: "insertwidth"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -436,7 +436,7 @@ test text-1.43 {configuration option: "maxundo"} -setup { .t cget -maxundo } -cleanup { destroy .t -} -result {5} +} -result 5 test text-1.43b {configuration option: "maxundo", default} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -445,7 +445,7 @@ test text-1.43b {configuration option: "maxundo", default} -setup { .t cget -maxundo } -cleanup { destroy .t -} -result {0} +} -result 0 test text-1.44 {configuration option: "maxundo"} -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 test text-1.46 {configuration option: "padx"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -483,7 +483,7 @@ test text-1.47 {configuration option: "pady"} -setup { .t cget -pady } -cleanup { destroy .t -} -result {82} +} -result 82 test text-1.48 {configuration option: "pady"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -540,7 +540,7 @@ test text-1.53 {configuration option: "selectborderwidth"} -setup { .t cget -selectborderwidth } -cleanup { destroy .t -} -result {21} +} -result 21 test text-1.54 {configuration option: "selectborderwidth"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -578,7 +578,7 @@ test text-1.57 {configuration option: "spacing1"} -setup { .t cget -spacing1 } -cleanup { destroy .t -} -result {20} +} -result 20 test text-1.58 {configuration option: "spacing1"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -597,7 +597,7 @@ test text-1.59 {configuration option: "spacing1"} -setup { .t cget -spacing1 } -cleanup { destroy .t -} -result {0} +} -result 0 test text-1.60 {configuration option: "spacing1"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -616,7 +616,7 @@ test text-1.61 {configuration option: "spacing2"} -setup { .t cget -spacing2 } -cleanup { destroy .t -} -result {5} +} -result 5 test text-1.62 {configuration option: "spacing2"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -635,7 +635,7 @@ test text-1.63 {configuration option: "spacing2"} -setup { .t cget -spacing2 } -cleanup { destroy .t -} -result {0} +} -result 0 test text-1.64 {configuration option: "spacing2"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -654,7 +654,7 @@ test text-1.65 {configuration option: "spacing3"} -setup { .t cget -spacing3 } -cleanup { destroy .t -} -result {20} +} -result 20 test text-1.66 {configuration option: "spacing3"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -673,7 +673,7 @@ test text-1.67 {configuration option: "spacing3"} -setup { .t cget -spacing3 } -cleanup { destroy .t -} -result {0} +} -result 0 test text-1.68 {configuration option: "spacing3"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -749,7 +749,7 @@ test text-1.75 {configuration option: "undo"} -setup { .t cget -undo } -cleanup { destroy .t -} -result {1} +} -result 1 test text-1.75b {configuration option: "undo", default} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -758,7 +758,7 @@ test text-1.75b {configuration option: "undo", default} -setup { .t cget -undo } -cleanup { destroy .t -} -result {0} +} -result 0 test text-1.76 {configuration option: "undo"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -777,7 +777,7 @@ test text-1.77 {configuration option: "width"} -setup { .t cget -width } -cleanup { destroy .t -} -result {73} +} -result 73 test text-1.78 {configuration option: "width"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t @@ -1004,7 +1004,7 @@ test text-5.4 {TextWidgetCmd procedure, "cget" option} -setup { .t cget -bd } -cleanup { destroy .t -} -result {17} +} -result 17 test text-6.1 {TextWidgetCmd procedure, "compare" option} -setup { @@ -1198,7 +1198,7 @@ test text-7.3 {TextWidgetCmd procedure, "debug" option} -setup { .t deb } -cleanup { destroy .t -} -result {1} +} -result 1 test text-7.4 {TextWidgetCmd procedure, "debug" option} -setup { text .t } -body { @@ -1206,7 +1206,7 @@ test text-7.4 {TextWidgetCmd procedure, "debug" option} -setup { .t debug } -cleanup { destroy .t -} -result {0} +} -result 0 test text-8.1 {TextWidgetCmd procedure, "delete" option} -setup { @@ -1252,7 +1252,7 @@ bOy GIrl .#@? x_yz Line 7" .t configure -state disabled .t delete 2.3 - .t g 2.0 2.end + .t get 2.0 2.end } -cleanup { destroy .t } -result {abcdefghijklm} @@ -1458,7 +1458,7 @@ Line 7" string equal [.t get 1.0 end-1c] $prevtext } -cleanup { destroy .t -} -result {1} +} -result 1 test text-8.22 {TextWidgetCmd procedure, "replace" option with undo} -setup { text .t set res {} @@ -1502,14 +1502,14 @@ Line 7" # Ensure that undo (even composite undo like 'replace') # works when the widget shows nothing useful. .t replace 2.1 2.3 foo - .t configure -start 1 -end 1 + .t configure -startline 1 -endline 1 .t edit undo - .t configure -start {} -end {} + .t configure -startline {} -endline {} .t configure -undo 0 string equal [.t get 1.0 end-1c] $prevtext } -cleanup { destroy .t -} -result {1} +} -result 1 test text-8.24 {TextWidgetCmd procedure, "replace" option with peers, undo} -setup { text .t } -body { @@ -1528,15 +1528,15 @@ Line 7" # works when the the event took place in one peer, which # is then deleted, before the undo takes place in another peer. .tt replace 2.1 2.3 foo - .tt configure -start 1 -end 1 + .tt configure -startline 1 -endline 1 destroy .tt .t edit undo - .t configure -start {} -end {} + .t configure -startline {} -endline {} .t configure -undo 0 string equal [.t get 1.0 end-1c] $prevtext } -cleanup { destroy .t -} -result {1} +} -result 1 test text-8.25 {TextWidgetCmd procedure, "replace" option with peers, undo} -setup { text .t } -body { @@ -1557,14 +1557,14 @@ Line 7" # which isn't showing everything. .tt replace 2.1 2.3 foo set res [.tt get 2.1 2.4] - .tt configure -start 1 -end 1 + .tt configure -startline 1 -endline 1 destroy .tt - .t configure -start 3 -end 4 + .t configure -startline 3 -endline 4 # msg will actually be set to a silently ignored error message here, # (that the .tt command doesn't exist), but that is not important. lappend res [catch {.t edit undo}] .t configure -undo 0 - .t configure -start {} -end {} + .t configure -startline {} -endline {} lappend res [string equal [.t get 1.0 end-1c] $prevtext] } -cleanup { destroy .t @@ -2091,7 +2091,7 @@ Line 7" .t count 5.7 5.3 } -cleanup { destroy .t -} -result {-4} +} -result -4 test text-10.7 {TextWidgetCmd procedure, "count" option} -setup { text .t .t insert 1.0 "Line 1 @@ -2105,7 +2105,7 @@ Line 7" .t count 5.3 5.5 } -cleanup { destroy .t -} -result {2} +} -result 2 test text-10.8 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2119,7 +2119,7 @@ Line 7" .t count 5.3 end } -cleanup { destroy .t -} -result {29} +} -result 29 test text-10.9 {TextWidgetCmd procedure, "count" option} -setup { text .t .t insert 1.0 "Line 1 @@ -2133,7 +2133,7 @@ Line 7" .t count 5.2 5.7 } -cleanup { destroy .t -} -result {5} +} -result 5 test text-10.10 {TextWidgetCmd procedure, "count" option} -setup { text .t .t insert 1.0 "Line 1 @@ -2147,7 +2147,7 @@ Line 7" .t count 5.2 5.3 } -cleanup { destroy .t -} -result {1} +} -result 1 test text-10.11 {TextWidgetCmd procedure, "count" option} -setup { text .t .t insert 1.0 "Line 1 @@ -2161,7 +2161,7 @@ Line 7" .t count 5.2 5.4 } -cleanup { destroy .t -} -result {2} +} -result 2 test text-10.12 {TextWidgetCmd procedure, "count" option} -setup { text .t .t insert 1.0 "Line 1 @@ -2191,7 +2191,7 @@ Line 7" .t count -displayindices 2.0 3.0 } -cleanup { destroy .t -} -result {2} +} -result 2 test text-10.14 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2207,7 +2207,7 @@ Line 7" .t count -displayindices 2.2 3.0 } -cleanup { destroy .t -} -result {0} +} -result 0 test text-10.15 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2224,7 +2224,7 @@ Line 7" .t count -displayindices 2.0 4.2 } -cleanup { destroy .t -} -result {5} +} -result 5 test text-10.16 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2247,7 +2247,7 @@ Line 7" .t count -displayindices 2.0 3.0 } -cleanup { destroy .t -} -result {3} +} -result 3 test text-10.17 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2270,7 +2270,7 @@ Line 7" .t count -displayindices 2.2 3.0 } -cleanup { destroy .t -} -result {1} +} -result 1 test text-10.18 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2295,7 +2295,7 @@ Line 7" .t count -displayindices a 3.0 } -cleanup { destroy .t -} -result {0} +} -result 0 test text-10.19 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2319,7 +2319,7 @@ Line 7" .t count -displayindices 2.0 4.2 } -cleanup { destroy .t -} -result {6} +} -result 6 test text-10.20 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2343,7 +2343,7 @@ Line 7" .t count -displaychars 2.0 3.0 } -cleanup { destroy .t -} -result {2} +} -result 2 test text-10.21 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2367,7 +2367,7 @@ Line 7" .t count -displaychars 2.2 3.0 } -cleanup { destroy .t -} -result {1} +} -result 1 test text-10.22 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2392,7 +2392,7 @@ Line 7" .t count -displaychars a 3.0 } -cleanup { destroy .t -} -result {0} +} -result 0 test text-10.23 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2416,7 +2416,7 @@ Line 7" .t count -displaychars 2.0 4.2 } -cleanup { destroy .t -} -result {5} +} -result 5 test text-10.24 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2491,7 +2491,7 @@ Line 7" .t count -indices 2.0 4.2 } -cleanup { destroy .t -} -result {21} +} -result 21 test text-10.27 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2516,7 +2516,7 @@ Line 7" .t count -chars 2.2 3.0 } -cleanup { destroy .t -} -result {10} +} -result 10 test text-10.28 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2541,7 +2541,7 @@ Line 7" .t count -chars a 3.0 } -cleanup { destroy .t -} -result {9} +} -result 9 test text-10.29 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2566,7 +2566,7 @@ Line 7" .t count -chars 2.0 4.2 } -cleanup { destroy .t -} -result {19} +} -result 19 test text-10.30 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2576,7 +2576,7 @@ test text-10.30 {TextWidgetCmd procedure, "count" option} -setup { .t count -lines 1.0 end } -cleanup { destroy .t -} -result {3} +} -result 3 test text-10.31 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2586,7 +2586,7 @@ test text-10.31 {TextWidgetCmd procedure, "count" option} -setup { .t count -lines end 1.0 } -cleanup { destroy .t -} -result {-3} +} -result -3 test text-10.32 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2606,7 +2606,7 @@ test text-10.33 {TextWidgetCmd procedure, "count" option} -setup { .t count -lines end end } -cleanup { destroy .t -} -result {0} +} -result 0 test text-10.34 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2616,7 +2616,7 @@ test text-10.34 {TextWidgetCmd procedure, "count" option} -setup { .t count -lines 1.5 2.5 } -cleanup { destroy .t -} -result {1} +} -result 1 test text-10.35 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2626,7 +2626,7 @@ test text-10.35 {TextWidgetCmd procedure, "count" option} -setup { .t count -lines 2.5 "2.5 lineend" } -cleanup { destroy .t -} -result {0} +} -result 0 test text-10.36 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2636,7 +2636,7 @@ test text-10.36 {TextWidgetCmd procedure, "count" option} -setup { .t count -lines 2.7 "1.0 lineend" } -cleanup { destroy .t -} -result {-1} +} -result -1 test text-10.37 {TextWidgetCmd procedure, "count" option} -setup { text .t } -body { @@ -2647,7 +2647,7 @@ test text-10.37 {TextWidgetCmd procedure, "count" option} -setup { .t count -displaylines 1.0 end } -cleanup { destroy .t -} -result {3} +} -result 3 test text-10.38 {TextWidgetCmd procedure, "count" option} -setup { text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .t -expand 1 -fill both @@ -2679,7 +2679,7 @@ test text-10.39 {TextWidgetCmd procedure, "count" option} -setup { } -cleanup { destroy .t } -result {2 6 1 5} -test text-9.2.45 {TextWidgetCmd procedure, "count" option} -setup { +test text-10.40 {TextWidgetCmd procedure, "count" option} -setup { text .t pack .t update @@ -2694,8 +2694,8 @@ test text-9.2.45 {TextWidgetCmd procedure, "count" option} -setup { set res [.t count -displaylines 2.0 3.0] } -cleanup { destroy .t -} -result {0} -test text-9.2.46 {TextWidgetCmd procedure, "count" option} -setup { +} -result 0 +test text-10.41 {TextWidgetCmd procedure, "count" option} -setup { toplevel .mytop pack [text .mytop.t -font TkFixedFont -bd 0 -padx 0 -wrap char] set spec [font measure TkFixedFont "Line 1+++Line 1---Li"] ; # 20 chars @@ -2717,7 +2717,7 @@ test text-9.2.46 {TextWidgetCmd procedure, "count" option} -setup { } -cleanup { destroy .mytop } -result {1 3} -test text-9.2.47 {TextWidgetCmd procedure, "count" option} -setup { +test text-10.42 {TextWidgetCmd procedure, "count" option} -setup { text .t pack .t update @@ -2771,7 +2771,7 @@ test text-11.2 {counting with tag priority eliding} -setup { .t count -displaychars 1.0 1.5 } -cleanup { destroy .t -} -result {5} +} -result 5 test text-11.3 {counting with tag priority eliding} -setup { text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2 } -body { @@ -2784,7 +2784,7 @@ test text-11.3 {counting with tag priority eliding} -setup { .t count -displaychars 1.0 1.5 } -cleanup { destroy .t -} -result {3} +} -result 3 test text-11.4 {counting with tag priority eliding} -setup { text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2 set res {} @@ -3414,7 +3414,7 @@ test text-14.14 {ConfigureText procedure} -body { selection get } -cleanup { destroy .t .t2 -} -result {1234} +} -result 1234 test text-14.15 {ConfigureText procedure} -body { text .t entry .t.e @@ -3428,7 +3428,7 @@ test text-14.15 {ConfigureText procedure} -body { selection get } -cleanup { destroy .t2 .t -} -result {1234} +} -result 1234 test text-14.16 {ConfigureText procedure} -body { text .t entry .t.e @@ -3457,7 +3457,7 @@ test text-14.17 {ConfigureText procedure} -body { return $result } -cleanup { destroy .t .t2 -} -result {1234} +} -result 1234 test text-14.18 {ConfigureText procedure} -constraints fonts -setup { toplevel .top text .top.t -font {Courier -12} -borderwidth 2 -highlightthickness 2 @@ -3960,7 +3960,7 @@ test text-20.5 {TextFetchSelection procedure, long selections} -setup { expr {[selection get] eq "$x\n"} } -cleanup { destroy .t -} -result {1} +} -result 1 test text-21.1 {TkTextLostSelection procedure} -constraints {x11} -setup { @@ -6447,7 +6447,7 @@ test text-25.1 {text widget vs hidden commands} -body { destroy .t set x [list [winfo children .] [interp hidden]] expr {$x eq $y} -} -result {1} +} -result 1 test text-26.1 {bug fix - 1642} -body { @@ -6540,7 +6540,7 @@ test text-27.8 {TextEditCmd procedure, modified flag} -body { .t edit modified } -cleanup { destroy .t -} -result {1} +} -result 1 test text-27.9 {TextEditCmd procedure, reset modified flag} -body { text .t pack .t @@ -6549,7 +6549,7 @@ test text-27.9 {TextEditCmd procedure, reset modified flag} -body { .t edit modified } -cleanup { destroy .t -} -result {0} +} -result 0 test text-27.10 {TextEditCmd procedure, set modified flag} -body { text .t pack .t @@ -6557,7 +6557,7 @@ test text-27.10 {TextEditCmd procedure, set modified flag} -body { .t edit modified } -cleanup { destroy .t -} -result {1} +} -result 1 test text-27.11 {TextEditCmd procedure, set modified flag repeat} -setup { text .t pack .t @@ -6627,7 +6627,7 @@ test text-27.14a {<<Modified>> virtual event - propagation to peers} -body { set ::retval } -cleanup { destroy .t .tt -} -result {4} +} -result 4 test text-27.15 {<<Selection>> virtual event on sel tagging} -body { set ::retval no_selection pack [text .t] @@ -6746,7 +6746,7 @@ test text-27.15g {No <<Selection>> virtual event on <<Cut>> without widget selec destroy .t } -result {no_<<Selection>>_event_fired} test text-27.16 {-maxundo configuration option} -body { - text .t -undo 1 -autoseparators 1 -maxundo 2 + text .t -undo 1 -autoseparators 1 -maxundo 2 pack .t .t insert end "line 1\n" .t delete 1.4 1.6 @@ -6979,13 +6979,13 @@ test text-28.1 {bug fix - 624372, ControlUtfProc long lines} -body { test text-29.1 {tabs - must be positive and must be increasing} -body { pack [text .t -wrap none] - .t configure -tabs {0} + .t configure -tabs 0 } -cleanup { destroy .t } -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} + .t configure -tabs -5 } -cleanup { destroy .t } -returnCodes {error} -result {tab stop "-5" is not at a positive distance} @@ -7008,7 +7008,7 @@ test text-29.4 {tabs - must be positive and must be increasing} -body { set result 1 } -cleanup { destroy .t -} -result {1} +} -result 1 test text-30.1 {repeated insert and scroll} -body { @@ -7021,7 +7021,7 @@ test text-30.1 {repeated insert and scroll} -body { set result 1 } -cleanup { destroy .t -} -result {1} +} -result 1 test text-30.2 {repeated insert and scroll} -body { pack [text .t] for {set i 0} {$i < 30} {incr i} { @@ -7032,7 +7032,7 @@ test text-30.2 {repeated insert and scroll} -body { set result 1 } -cleanup { destroy .t -} -result {1} +} -result 1 test text-30.3 {repeated insert and scroll} -body { pack [text .t] for {set i 0} {$i < 30} {incr i} { @@ -7043,7 +7043,7 @@ test text-30.3 {repeated insert and scroll} -body { set result 1 } -cleanup { destroy .t -} -result {1} +} -result 1 test text-30.4 {repeated insert and scroll} -body { pack [text .t] for {set i 0} {$i < 30} {incr i} { @@ -7054,7 +7054,7 @@ test text-30.4 {repeated insert and scroll} -body { set result 1 } -cleanup { destroy .t -} -result {1} +} -result 1 test text-31.1 {peer widgets} -body { @@ -7099,7 +7099,7 @@ test text-31.4 {peer widgets} -body { for {set i 1} {$i < 20} {incr i} { .t insert end "Line $i\n" } - pack [.t peer create .top.t -start 5 -end 11] + pack [.t peer create .top.t -startline 5 -endline 11] update destroy .t .top } -result {} @@ -7109,7 +7109,7 @@ test text-31.5 {peer widgets} -body { for {set i 1} {$i < 20} {incr i} { .t insert end "Line $i\n" } - pack [.t peer create .top.t -start 5 -end 11] + pack [.t peer create .top.t -startline 5 -endline 11] pack [.top.t peer create .top.t2] set res [list [.top.t index end] [.top.t2 index end]] update @@ -7123,8 +7123,8 @@ test text-31.6 {peer widgets} -body { for {set i 1} {$i < 20} {incr i} { .t insert end "Line $i\n" } - pack [.t peer create .top.t -start 5 -end 11] - pack [.top.t peer create .top.t2 -start {} -end {}] + pack [.t peer create .top.t -startline 5 -endline 11] + pack [.top.t peer create .top.t2 -startline {} -endline {}] set res [list [.top.t index end] [.top.t2 index end]] update return $res @@ -7137,21 +7137,21 @@ test text-31.7 {peer widgets} -body { for {set i 1} {$i < 20} {incr i} { .t insert end "Line $i\n" } - pack [.t peer create .top.t -start 5 -end 11] + pack [.t peer create .top.t -startline 5 -endline 11] update ; update set p1 [.top.t count -update -ypixels 1.0 end] set p2 [.t count -update -ypixels 5.0 11.0] expr {$p1 eq $p2} } -cleanup { destroy .t .top -} -result {1} +} -result 1 test text-31.8 {peer widgets} -body { toplevel .top pack [text .t] for {set i 1} {$i < 20} {incr i} { .t insert end "Line $i\n" } - pack [.t peer create .top.t -start 5 -end 11] + pack [.t peer create .top.t -startline 5 -endline 11] update ; update .t delete 3.0 6.0 .top.t index end @@ -7164,7 +7164,7 @@ test text-31.9 {peer widgets} -body { for {set i 1} {$i < 20} {incr i} { .t insert end "Line $i\n" } - pack [.t peer create .top.t -start 5 -end 11] + pack [.t peer create .top.t -startline 5 -endline 11] update ; update .t delete 8.0 12.0 .top.t index end @@ -7177,7 +7177,7 @@ test text-31.10 {peer widgets} -body { for {set i 1} {$i < 20} {incr i} { .t insert end "Line $i\n" } - pack [.t peer create .top.t -start 5 -end 11] + pack [.t peer create .top.t -startline 5 -endline 11] update ; update .t delete 3.0 13.0 .top.t index end @@ -7193,7 +7193,7 @@ test text-31.11 {peer widgets} -setup { } .t tag add sel 1.0 end-1c lappend res [.t tag ranges sel] - .t configure -start 10 -end 20 + .t configure -startline 10 -endline 20 lappend res [.t tag ranges sel] return $res } -cleanup { @@ -7208,7 +7208,7 @@ test text-31.12 {peer widgets} -setup { } .t tag add sel 1.0 end-1c lappend res [.t tag ranges sel] - .t configure -start 11 + .t configure -startline 11 lappend res [.t tag ranges sel] return $res } -cleanup { @@ -7223,7 +7223,7 @@ test text-31.13 {peer widgets} -setup { } .t tag add sel 1.0 end-1c lappend res [.t tag ranges sel] - .t configure -end 90 + .t configure -endline 90 lappend res [.t tag ranges sel] destroy .t return $res @@ -7239,7 +7239,7 @@ test text-31.14 {peer widgets} -setup { } .t tag add sel 1.0 3.0 5.0 7.0 9.0 11.0 13.0 15.0 17.0 19.0 lappend res [.t tag prevrange sel 1.0] - .t configure -start 6 -end 12 + .t configure -startline 6 -endline 12 lappend res [.t tag ranges sel] lappend res "next" [.t tag nextrange sel 4.0] \ [.t tag nextrange sel 5.0] [.t tag nextrange sel 6.0] \ @@ -7259,7 +7259,7 @@ test text-31.15 {peer widgets} -setup { .t insert end "Line $i\n" } .t tag add sel 1.0 3.0 9.0 11.0 13.0 15.0 17.0 19.0 - .t configure -start 6 -end 12 + .t configure -startline 6 -endline 12 lappend res [.t tag ranges sel] lappend res "next" [.t tag nextrange sel 4.0] \ [.t tag nextrange sel 5.0] [.t tag nextrange sel 6.0] \ @@ -7279,7 +7279,7 @@ test text-31.16 {peer widgets} -setup { .t insert end "Line $i\n" } .t tag add sel 1.0 7.0 9.0 11.0 13.0 15.0 17.0 19.0 - .t configure -start 6 -end 12 + .t configure -startline 6 -endline 12 lappend res [.t tag ranges sel] lappend res "next" [.t tag nextrange sel 4.0] \ [.t tag nextrange sel 5.0] [.t tag nextrange sel 6.0] \ @@ -7300,11 +7300,11 @@ test text-31.17 {peer widgets} -setup { } .t tag add sel 1.0 11.0 lappend res [.t tag ranges sel] - lappend res [catch {.t configure -start 15 -end 10}] + lappend res [catch {.t configure -startline 15 -endline 10}] lappend res [.t tag ranges sel] - .t configure -start 6 -end 12 + .t configure -startline 6 -endline 12 lappend res [.t tag ranges sel] - .t configure -start {} -end {} + .t configure -startline {} -endline {} lappend res [.t tag ranges sel] return $res } -cleanup { @@ -7371,9 +7371,9 @@ test text-32.1 {line heights on creation} -setup { expr {$before eq $after} } -cleanup { destroy .t -} -result {1} +} -result 1 -test text-32.2 {peer widget -start, -end and deletion (bug 1630262)} -setup { +test text-32.2 {peer widget -start, -endline and deletion (bug 1630262)} -setup { destroy .t .pt set res {} } -body { @@ -7401,9 +7401,9 @@ test text-32.2 {peer widget -start, -end and deletion (bug 1630262)} -setup { set res 1 } -cleanup { destroy .pt -} -result {1} +} -result 1 -test text-32.3 {peer widget -start, -end and deletion (bug 1630262)} -setup { +test text-32.3 {peer widget -start, -endline and deletion (bug 1630262)} -setup { destroy .t .pt set res {} } -body { @@ -7424,7 +7424,7 @@ test text-32.3 {peer widget -start, -end and deletion (bug 1630262)} -setup { destroy .pt } -result {4 3 {Line 5}} -test text-32.4 {peer widget -start, -end and deletion (bug 1630262)} -setup { +test text-32.4 {peer widget -start, -endline and deletion (bug 1630262)} -setup { destroy .t .pt set res {} } -body { @@ -7485,7 +7485,7 @@ test text-33.2 {TextWidgetCmd procedure, "peer" option} -setup { test text-33.3 {TextWidgetCmd procedure, "peer" option} -setup { text .t } -body { - .t pee names + .t peer names } -cleanup { destroy .t } -returnCodes {ok} -result {} @@ -7517,17 +7517,17 @@ test text-33.6 {TextWidgetCmd procedure, "peer" option} -setup { } -result {.t2 .t {}} test text-33.7 {peer widget -start, -end} -body { text .t - set res [.t configure -start 10 -end 5] + set res [.t configure -startline 10 -endline 5] return $res } -cleanup { destroy .t -} -returnCodes {2} -result {} +} -returnCodes 2 -result {} test text-33.8 {peer widget -start, -end} -body { text .t for {set i 1} {$i < 100} {incr i} { .t insert end "Line $i\n" } - .t configure -start 10 -end 5 + .t configure -startline 10 -endline 5 } -cleanup { destroy .t } -returnCodes {error} -result {-startline must be less than or equal to -endline} @@ -7536,7 +7536,7 @@ test text-33.9 {peer widget -start, -end} -body { for {set i 1} {$i < 100} {incr i} { .t insert end "Line $i\n" } - .t configure -start 5 -end 10 + .t configure -startline 5 -endline 10 } -cleanup { destroy .t } -returnCodes {ok} -result {} @@ -7546,11 +7546,11 @@ test text-33.10 {peer widget -start, -end} -body { .t insert end "Line $i\n" } set res [.t index end] - lappend res [catch {.t configure -start 5 -end 10 -tab foo}] + lappend res [catch {.t configure -startline 5 -endline 10 -tab foo}] lappend res [.t index end] - lappend res [catch {.t configure -tab foo -start 15 -end 20}] + lappend res [catch {.t configure -tab foo -startline 15 -endline 20}] lappend res [.t index end] - .t configure -start {} -end {} + .t configure -startline {} -endline {} lappend res [.t index end] return $res } -cleanup { @@ -7562,18 +7562,18 @@ test text-33.11 {peer widget -start, -end} -body { .t insert end "Line $i\n" } set res [.t index end] - lappend res [catch {.t configure -start 5 -end 15}] + lappend res [catch {.t configure -startline 5 -endline 15}] lappend res [.t index end] - lappend res [catch {.t configure -start 10 -end 40}] + lappend res [catch {.t configure -startline 10 -endline 40}] lappend res [.t index end] - .t configure -start {} -end {} + .t configure -startline {} -endline {} lappend res [.t index end] return $res } -cleanup { destroy .t } -result {101.0 0 11.0 0 31.0 101.0} -test text-34.1 {peer widget -start, -end and selection} -setup { +test text-34.1 {peer widget -start, -endline and selection} -setup { text .t set res {} } -body { @@ -7582,17 +7582,17 @@ test text-34.1 {peer widget -start, -end and selection} -setup { } .t tag add sel 10.0 20.0 lappend res [.t tag ranges sel] - .t configure -start 5 -end 30 + .t configure -startline 5 -endline 30 lappend res [.t tag ranges sel] - .t configure -start 5 -end 15 + .t configure -startline 5 -endline 15 lappend res [.t tag ranges sel] - .t configure -start 15 -end 30 + .t configure -startline 15 -endline 30 lappend res [.t tag ranges sel] - .t configure -start 15 -end 16 + .t configure -startline 15 -endline 16 lappend res [.t tag ranges sel] - .t configure -start 25 -end 30 + .t configure -startline 25 -endline 30 lappend res [.t tag ranges sel] - .t configure -start {} -end {} + .t configure -startline {} -endline {} lappend res [.t tag ranges sel] return $res } -cleanup { @@ -7601,7 +7601,6 @@ test text-34.1 {peer widget -start, -end and selection} -setup { test text-35.1 {widget dump -command alters tags} -setup { proc Dumpy {key value index} { -#puts "KK: $key, $value" .t tag add $value [list $index linestart] [list $index lineend] } text .t @@ -7615,7 +7614,6 @@ test text-35.1 {widget dump -command alters tags} -setup { } -result {ok} test text-35.2 {widget dump -command makes massive changes} -setup { proc Dumpy {key value index} { -#puts "KK: $key, $value" .t delete 1.0 end } text .t @@ -7629,7 +7627,6 @@ test text-35.2 {widget dump -command makes massive changes} -setup { } -result {ok} test text-35.3 {widget dump -command destroys widget} -setup { proc Dumpy {key value index} { -#puts "KK: $key, $value" destroy .t } text .t diff --git a/tests/textDisp.test b/tests/textDisp.test index 5627d86..7d8e189 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -265,9 +265,9 @@ test textDisp-1.1 {GetStyle procedure, priorities and tab stops} { .t delete 1.0 end .t insert 1.0 "x\ty" .t tag delete x y z - .t tag configure x -tabs {50} + .t tag configure x -tabs 50 .t tag configure y -foreground black - .t tag configure z -tabs {70} + .t tag configure z -tabs 70 .t tag add x 1.0 1.end .t tag add y 1.0 1.end .t tag add z 1.0 1.end @@ -275,7 +275,7 @@ test textDisp-1.1 {GetStyle procedure, priorities and tab stops} { set x [lindex [.t bbox 1.2] 0] .t tag configure z -tabs {} lappend x [lindex [.t bbox 1.2] 0] - .t tag configure z -tabs {30} + .t tag configure z -tabs 30 .t tag raise x update idletasks lappend x [lindex [.t bbox 1.2] 0] @@ -838,7 +838,7 @@ test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { .t yview moveto 1 update winfo ismapped .b -} {0} +} 0 .t configure -wrap word .t delete 1.0 end .t insert end "Line 1\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\nLine 7\n" @@ -2021,7 +2021,7 @@ test textDisp-13.11 {TkTextSeeCmd procedure} {} { set res [.top2.t2 compare $ref == $new] destroy .top2 set res -} {0} +} 0 wm geom . {} .t configure -wrap none @@ -2210,7 +2210,7 @@ test textDisp-15.8 {Scrolling near end of window} { set res [.tf.f.t compare $newind > $refind] destroy .tf set res -} {1} +} 1 .t configure -wrap char .t delete 1.0 end @@ -2921,66 +2921,66 @@ test textDisp-19.11 {GetYView procedure} { } {0.5 1.0} test textDisp-19.11.2 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 1.0 end -} {20} +} 20 test textDisp-19.11.3 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines end 1.0 -} {-20} +} -20 test textDisp-19.11.4 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 1.1 1.3 -} {0} +} 0 test textDisp-19.11.5 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 16.1 -} {0} +} 0 test textDisp-19.11.5.1 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 16.5 -} {0} +} 0 test textDisp-19.11.6 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 16.24 -} {1} +} 1 test textDisp-19.11.7 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 16.40 -} {2} +} 2 test textDisp-19.11.8 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines "16.0 displaylineend +1c" "16.0 lineend" -} {3} +} 3 test textDisp-19.11.9 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 "16.0 lineend" -} {4} +} 4 test textDisp-19.11.10 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 "16.0 +4displaylines" -} {4} +} 4 test textDisp-19.11.11 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines 16.0 "16.0 +2displaylines" -} {2} +} 2 test textDisp-19.11.12 {TextWidgetCmd procedure, "count -displaylines"} { .t count -displaylines "16.0 +1displayline" "16.0 +2displaylines -1c" -} {0} +} 0 .t tag configure elide -elide 1 test textDisp-19.11.13 {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "16.0 +1displaylines" "16.0 +1displaylines +6c" .t count -displaylines 16.0 "16.0 +4displaylines" -} {4} +} 4 test textDisp-19.11.14 {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "16.0 +1displaylines" "16.0 +1displaylines displaylineend" .t count -displaylines 16.0 "16.0 +4displaylines" -} {4} +} 4 test textDisp-19.11.15 {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "16.0 +1displaylines" "16.0 +2displaylines" .t count -displaylines 16.0 "16.0 +4displaylines -1c" -} {3} +} 3 test textDisp-19.11.15a {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "16.0 +1displaylines" "16.0 +2displaylines" .t count -displaylines 16.0 "16.0 +4displaylines" -} {4} +} 4 test textDisp-19.11.16 {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "12.0" "14.0" .t count -displaylines 12.0 16.0 -} {2} +} 2 test textDisp-19.11.17 {TextWidgetCmd procedure, "index +displaylines"} { .t tag remove elide 1.0 end .t tag add elide "12.0" "14.0" @@ -3001,7 +3001,7 @@ test textDisp-19.11.19 {TextWidgetCmd procedure, "count -displaylines"} { .t tag remove elide 1.0 end .t tag add elide "12.0" "16.0 +1displaylines" .t count -displaylines 12.0 17.0 -} {4} +} 4 test textDisp-19.11.20 {TextWidgetCmd procedure, "index +displaylines"} { .t tag remove elide 1.0 end .t tag add elide "12.0" "16.0 +1displaylines" @@ -3311,7 +3311,7 @@ set res [.tt.u count -displaylines 3.10 2.173] destroy .tt unset message set res -} {-1} +} -1 .t delete 1.0 end .t insert end "Line 1" @@ -3947,7 +3947,7 @@ test textDisp-26.5 {AdjustForTab procedure, numeric alignment} { .t tag add y 1.2 .t tag add y 1.5 lindex [.t bbox 1.3] 0 -} {120} +} 120 test textDisp-26.6 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\t1,456.234 @@ -3956,7 +3956,7 @@ test textDisp-26.6 {AdjustForTab procedure, numeric alignment} { .t tag add x 1.0 end .t tag add y 1.2 lindex [.t bbox 1.7] 0 -} {120} +} 120 test textDisp-26.7 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\t1.456.234,7 @@ -3965,7 +3965,7 @@ test textDisp-26.7 {AdjustForTab procedure, numeric alignment} { .t tag add x 1.0 end .t tag add y 1.2 lindex [.t bbox 1.11] 0 -} {120} +} 120 test textDisp-26.8 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\ttest @@ -3974,7 +3974,7 @@ test textDisp-26.8 {AdjustForTab procedure, numeric alignment} { .t tag add x 1.0 end .t tag add y 1.2 lindex [.t bbox 1.6] 0 -} {120} +} 120 test textDisp-26.9 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\t1234 @@ -3983,7 +3983,7 @@ test textDisp-26.9 {AdjustForTab procedure, numeric alignment} { .t tag add x 1.0 end .t tag add y 1.2 lindex [.t bbox 1.6] 0 -} {120} +} 120 test textDisp-26.10 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\t1.234567 @@ -3992,7 +3992,7 @@ test textDisp-26.10 {AdjustForTab procedure, numeric alignment} { .t tag add x 1.0 end .t tag add y 1.5 lindex [.t bbox 1.3] 0 -} {120} +} 120 test textDisp-26.11 {AdjustForTab procedure, numeric alignment} { .t delete 1.0 end .t insert 1.0 a\tx=1.234567 @@ -4002,7 +4002,7 @@ test textDisp-26.11 {AdjustForTab procedure, numeric alignment} { .t tag add y 1.7 .t tag add y 1.9 lindex [.t bbox 1.5] 0 -} {120} +} 120 test textDisp-26.12 {AdjustForTab procedure, adjusting chunks} { .t delete 1.0 end .t insert 1.0 a\tx1.234567 @@ -4015,7 +4015,7 @@ test textDisp-26.12 {AdjustForTab procedure, adjusting chunks} { .t window create 1.3 -window .b update lindex [.t bbox 1.5] 0 -} {120} +} 120 test textDisp-26.13 {AdjustForTab procedure, not enough space} { .t delete 1.0 end .t insert 1.0 "abc\txyz\tqrs\txyz\t0" @@ -4207,7 +4207,7 @@ test textDisp-27.7.2 {SizeOfTab procedure, fractional tab interpolation problem} .t configure -tabs $precisetab update expr {[lindex $res 0] - [lindex [.t bbox 1.20] 0]} -} {0} +} 0 .t configure -wrap char -tabs {} -width 20 update @@ -4820,7 +4820,7 @@ test textDisp-33.3 {one line longer than fits in the widget} { .tt sync # Each line should have been recalculated just once expr {[llength $tk_textHeightCalc] == [.tt count -displaylines 1.0 end]} -} {1} +} 1 test textDisp-33.4 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] @@ -4887,7 +4887,7 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { set negative } -cleanup { destroy .t1 -} -result {0} +} -result 0 test textDisp-35.1 {Init value of charHeight - Dancing scrollbar bug 1499165} -setup { pack [text .t1] -fill both -expand y -side left diff --git a/tests/textIndex.test b/tests/textIndex.test index a191e27..2b652b4 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -810,7 +810,7 @@ test textIndex-19.12.1 {Display lines} { test textIndex-19.12.2 {Display lines} { .t compare [.t index "2.50 + 100 displaylines"] == "end - 1 c" -} {1} +} 1 test textIndex-19.13 {Display lines} { destroy {*}[pack content .] diff --git a/tests/textMark.test b/tests/textMark.test index 4d2e623..6c4d4cd 100644 --- a/tests/textMark.test +++ b/tests/textMark.test @@ -52,7 +52,7 @@ test textMark-1.4 {TkTextMarkCmd - "gravity" option} -body { } -result {right 1.4} test textMark-1.5 {TkTextMarkCmd - "gravity" option} -body { .t mark set x 1.3 - .t mark g x left + .t mark gr x left .t insert 1.3 x list [.t mark gravity x] [.t index x] } -result {left 1.3} @@ -177,7 +177,7 @@ test textMark-6.4 {TkTextMarkNameToIndex, with mark outside -startline/-endline } -result {1 {bad text index "mymark"} 1.0 1.0 1 {bad text index "mymark"} L 1 {bad text index "mymark"}} test textMark-6.5 {insert and current marks in an empty peer - bug 3487407} -body { .t mark set insert 1.0 - .t configure -start 5 -end 5 + .t configure -startline 5 -endline 5 set res [.t index insert] } -cleanup { .t configure -startline {} -endline {} diff --git a/tests/textTag.test b/tests/textTag.test index b8ec899..145fb16 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -1214,7 +1214,6 @@ test textTag-14.4 {SortTags} -setup { } -result {x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29} - set c [.t bbox 2.1] set x1 [expr {[lindex $c 0] + [lindex $c 2]/2}] set y1 [expr {[lindex $c 1] + [lindex $c 3]/2}] diff --git a/tests/textWind.test b/tests/textWind.test index 260ba66..c03170f 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -171,7 +171,7 @@ test textWind-2.7 {TkTextWindowCmd procedure, "cget" option} -setup { .t window cget .f -pady } -cleanup { destroy .f -} -returnCodes ok -result {2} +} -returnCodes ok -result 2 test textWind-2.8 {TkTextWindowCmd procedure} -body { .t window co } -returnCodes error -result {wrong # args: should be ".t window configure index ?-option value ...?"} @@ -1414,7 +1414,7 @@ test textWind-17.1 {peer widgets and embedded windows} -setup { update destroy .t .tt winfo exists .f -} -result {0} +} -result 0 test textWind-17.2 {peer widgets and embedded windows} -setup { destroy .t .f .tt diff --git a/tests/tk.test b/tests/tk.test index d2e9044..bf8db0c 100644 --- a/tests/tk.test +++ b/tests/tk.test @@ -28,7 +28,7 @@ test tk-2.2 {tk command: appname} -body { test tk-2.3 {tk command: appname} -constraints unix -body { tk appname bazfoogarply expr {[lsearch -exact [winfo interps] [tk appname]] >= 0} -} -result {1} +} -result 1 test tk-2.4 {tk command: appname} -body { tk appname [tk appname] } -result [tk appname] @@ -64,21 +64,21 @@ test tk-3.7 {tk command: scaling: set new} -body { test tk-3.8 {tk command: scaling: negative} -body { tk scaling -1 expr {[tk scaling] > 0} -} -result {1} +} -result 1 test tk-3.9 {tk command: scaling: too big} -body { tk scaling 1000000 expr {[tk scaling] < 10000} -} -result {1} +} -result 1 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 .]} -} -result {0} +} -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 .]} -} -result {0} +} -result 0 tk scaling $scaling # Value stored to restore default settings after 4.* tests @@ -137,7 +137,7 @@ test tk-5.5 {tk caret} -body { } -result {-height 12 -x 10 -y 11} test tk-5.6 {tk caret} -body { tk caret . -x 20 -y 25 -h 30; tk caret . -hei -} -result {30} +} -result 30 # tk inactive test tk-6.1 {tk inactive} -body { diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 0981668..383a5d5 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -117,7 +117,7 @@ test unixEmbed-1.3 {TkpUseWindow procedure, inheriting colormap} -constraints { colorsFree .x } -cleanup { deleteWindows -} -result {0} +} -result 0 test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} -constraints { unix nonPortable } -setup { @@ -130,7 +130,7 @@ test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} -constraints { colorsFree .x } -cleanup { deleteWindows -} -result {1} +} -result 1 test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} -constraints { unix testembed notAqua diff --git a/tests/unixFont.test b/tests/unixFont.test index 3661ae2..3aeaa22 100644 --- a/tests/unixFont.test +++ b/tests/unixFont.test @@ -74,7 +74,7 @@ test unixfont-1.1 {TkpGetNativeFont procedure: not native} {x11 noExceed} { } {1 {font "" doesn't exist}} test unixfont-1.2 {TkpGetNativeFont procedure: native} {x11 failsOnUbuntu} { font measure fixed 0 -} {6} +} 6 test unixfont-2.1 {TkpGetFontFromAttributes procedure: no family} x11 { font actual {-size 10} @@ -119,7 +119,7 @@ test unixfont-2.9 {TkpGetFontFromAttributes: reject adobe courier if possible} { } {courier} test unixfont-2.10 {TkpGetFontFromAttributes: scalable font found} {x11 haveCourier37Font} { lindex [font actual {-family courier -size 37}] 3 -} {37} +} 37 test unixfont-2.11 {TkpGetFontFromAttributes: font cannot be loaded} x11 { # On Linux, XListFonts() was returning names for fonts that do not # actually exist, causing the subsequent XLoadQueryFont() to fail @@ -177,7 +177,7 @@ test unixfont-5.9 {Tk_MeasureChars procedure: TK_PARTIAL_OK} {x11 failsOnUbuntu} .b.c dchars $t 0 end .b.c insert $t 0 "0000" .b.c index $t @[expr int($ax*2.5)],1 -} {2} +} 2 test unixfont-5.10 {Tk_MeasureChars procedure: TK_AT_LEAST_ONE} x11 { .b.l config -text "000000000000" getsize @@ -246,7 +246,7 @@ test unixfont-8.1 {AllocFont procedure: use old font} x11 { } {} test unixfont-8.2 {AllocFont procedure: parse information from XLFD} x11 { expr {[lindex [font actual {-family times -size 0}] 3] == 0} -} {0} +} 0 test unixfont-8.3 {AllocFont procedure: can't parse info from name} x11 { catch {unset fontArray} # check that font actual returns the correct attributes. @@ -266,7 +266,7 @@ test unixfont-8.4 {AllocFont procedure: classify characters} {x11 failsOnUbuntu } [expr $cx*13] test unixfont-8.5 {AllocFont procedure: setup widths of normal chars} x11 { font metrics $courier -fixed -} {1} +} 1 test unixfont-8.6 {AllocFont procedure: setup widths of special chars} {x11 failsOnUbuntu failsOnXQuarz} { set x 0 incr x [font measure $courier "\001"] ;# 4 diff --git a/tests/unixSelect.test b/tests/unixSelect.test index a702587..d3da806 100644 --- a/tests/unixSelect.test +++ b/tests/unixSelect.test @@ -121,7 +121,7 @@ test unixSelect-1.1 {TkSelGetSelection procedure: simple i18n text} -constraints } -cleanup { cleanupbg destroy .e -} -result {4} +} -result 4 test unixSelect-1.2 {TkSelGetSelection procedure: simple i18n text, iso8859-1} -constraints { x11 @@ -331,7 +331,7 @@ test unixSelect-1.13 {TkSelGetSelection procedure: simple i18n text, utf-8} -con } -cleanup { destroy .e cleanupbg -} -result {5} +} -result 5 test unixSelect-1.14 {TkSelGetSelection procedure: simple i18n text, utf-8} -constraints { x11 diff --git a/tests/unixWm.test b/tests/unixWm.test index e17607d..d296858 100644 --- a/tests/unixWm.test +++ b/tests/unixWm.test @@ -429,7 +429,7 @@ test unixWm-9.3 {TkWmMapWindow procedure, iconic windows} unix { wm geom .t +0+0 wm iconify .t winfo ismapped .t -} {0} +} 0 test unixWm-9.4 {TkWmMapWindow procedure, icon windows} unix { destroy .t toplevel .t -width 100 -height 50 -bg blue @@ -437,14 +437,14 @@ test unixWm-9.4 {TkWmMapWindow procedure, icon windows} unix { wm iconwindow . .t update set result [winfo ismapped .t] -} {0} +} 0 test unixWm-9.5 {TkWmMapWindow procedure, normal windows} unix { destroy .t toplevel .t -width 200 -height 20 wm geom .t +0+0 update winfo ismapped .t -} {1} +} 1 test unixWm-10.1 {TkWmDeadWindow procedure, canceling UpdateGeometry idle handler} unix { destroy .t @@ -678,7 +678,7 @@ test unixWm-18.1 {Tk_WmCmd procedure, "frame" option} unix { } {1 {wrong # args: should be "wm frame window"}} test unixWm-18.2 {Tk_WmCmd procedure, "frame" option} {unix nonPortable} { expr [wm frame .t] == [winfo id .t] -} {0} +} 0 test unixWm-18.3 {Tk_WmCmd procedure, "frame" option} {unix nonPortable} { destroy .t2 toplevel .t2 @@ -688,7 +688,7 @@ test unixWm-18.3 {Tk_WmCmd procedure, "frame" option} {unix nonPortable} { set result [expr [wm frame .t2] == [winfo id .t2]] destroy .t2 set result -} {1} +} 1 test unixWm-19.1 {Tk_WmCmd procedure, "geometry" option} unix { list [catch {wm geometry .t 12 13} msg] $msg @@ -799,7 +799,7 @@ test unixWm-21.4 {Tk_WmCmd procedure, "group" option, make window exist} {unix t set result [expr [testwrapper .t2] - [lindex $hints 8]] destroy .t2 set result -} {0} +} 0 test unixWm-21.5 {Tk_WmCmd procedure, "group" option, create leader wrapper} {unix testwrapper} { destroy .t2 destroy .t3 @@ -878,7 +878,7 @@ test unixWm-23.5 {Tk_WmCmd procedure, "iconify" option} {unix failsOnUbuntu fail set result [winfo ismapped .t2] destroy .t2 set result -} {0} +} 0 test unixWm-23.6 {Tk_WmCmd procedure, "iconify" option} {unix failsOnUbuntu failsOnXQuarz} { destroy .t2 toplevel .t2 @@ -1754,7 +1754,7 @@ test unixWm-48.11 {ParseGeometry procedure} unix { } {0} test unixWm-48.12 {ParseGeometry procedure} unix { catch {wm geometry .t +30+-10} -} {0} +} 0 test unixWm-48.13 {ParseGeometry procedure, resize causes window to move} unix { destroy .t toplevel .t -width 200 -height 200 @@ -1881,7 +1881,7 @@ test unixWm-50.3 { 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]}]] + [child eval {winfo containing $x [expr $y + 50]}]] interp delete child set x [winfo rootx .t] set y [winfo rooty .t] @@ -2271,7 +2271,7 @@ test unixWm-54.2 {TkpMakeMenuWindow procedure, setting override_redirect} {unix set result [wm overrideredirect .m] destroy .m set result -} {1} +} 1 # No tests for TkGetPointerCoords, CreateWrapper, or GetMaxSize. diff --git a/tests/util.test b/tests/util.test index c1ec6a5..bd347d0 100644 --- a/tests/util.test +++ b/tests/util.test @@ -39,22 +39,22 @@ test util-1.7 {Tk_GetScrollInfo procedure} -body { .l yview 0 .l yview scroll 2 pages .l nearest 0 -} -result {6} +} -result 6 test util-1.8 {Tk_GetScrollInfo procedure} -body { .l yview 15 .l yview scroll -2 pages .l nearest 0 -} -result {9} +} -result 9 test util-1.9 {Tk_GetScrollInfo procedure} -body { .l yview 0 .l yview scroll 2 units .l nearest 0 -} -result {2} +} -result 2 test util-1.10 {Tk_GetScrollInfo procedure} -body { .l yview 15 .l yview scroll -2 units .l nearest 0 -} -result {13} +} -result 13 test util-1.11 {Tk_GetScrollInfo procedure} -body { .l yview scroll 3 zips } -returnCodes error -result {bad argument "zips": must be units or pages} diff --git a/tests/visual.test b/tests/visual.test index 13d6fd2..8d63097 100644 --- a/tests/visual.test +++ b/tests/visual.test @@ -455,7 +455,7 @@ test visual-7.1 {Tk_GetColormap, "new"} -constraints { colorsFree .t2 } -cleanup { deleteWindows -} -result {0} +} -result 0 test visual-7.2 {Tk_GetColormap, "new"} -constraints { defaultPseudocolor8 nonPortable } -setup { @@ -468,7 +468,7 @@ test visual-7.2 {Tk_GetColormap, "new"} -constraints { colorsFree .t2 } -cleanup { deleteWindows -} -result {1} +} -result 1 test visual-7.3 {Tk_GetColormap, copy from other window} -constraints { defaultPseudocolor8 nonPortable } -setup { @@ -484,7 +484,7 @@ test visual-7.3 {Tk_GetColormap, copy from other window} -constraints { colorsFree .t2 } -cleanup { deleteWindows -} -result {1} +} -result 1 test visual-7.4 {Tk_GetColormap, copy from other window} -constraints { defaultPseudocolor8 nonPortable } -setup { @@ -500,7 +500,7 @@ test visual-7.4 {Tk_GetColormap, copy from other window} -constraints { colorsFree .t2 } -cleanup { deleteWindows -} -result {0} +} -result 0 test visual-7.5 {Tk_GetColormap, copy from other window} -constraints { defaultPseudocolor8 nonPortable } -setup { diff --git a/tests/winDialog.test b/tests/winDialog.test index 1384770..4f1c98d 100755 --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -118,7 +118,7 @@ test winDialog-1.1 {Tk_ChooseColorObjCmd} -constraints { then { Click cancel } -} -result {0} +} -result 0 test winDialog-1.2 {Tk_ChooseColorObjCmd} -constraints { testwinevent } -body { @@ -229,7 +229,7 @@ test winDialog-5.1 {GetFileName: no arguments} -constraints { then { Click cancel } -} -result {0} +} -result 0 test winDialog-5.2 {GetFileName: one argument} -constraints { nt } -body { @@ -242,7 +242,7 @@ test winDialog-5.3 {GetFileName: many arguments} -constraints { then { Click cancel } -} -result {0} +} -result 0 test winDialog-5.4 {GetFileName: Tcl_GetIndexFromObj() != TCL_OK} -constraints { nt } -body { @@ -259,7 +259,7 @@ test winDialog-5.5 {GetFileName: Tcl_GetIndexFromObj() == TCL_OK} -constraints { # https://core.tcl-lang.org/tk/tktview/4a0451f5291b3c9168cc560747dae9264e1d2ef6 # $x is expected to be empty append x $y -} -result {0} +} -result 0 test winDialog-5.6 {GetFileName: valid option, but missing value} -constraints { nt } -body { @@ -741,7 +741,7 @@ test winDialog-5.16 {GetFileName: parent} -constraints { destroy .t } return $x -} -result {1} +} -result 1 test winDialog-5.17 {GetFileName: title} -constraints { nt testwinevent } -body { @@ -751,7 +751,7 @@ test winDialog-5.17 {GetFileName: title} -constraints { then { Click cancel } -} -result {0} +} -result 0 if {[vista?]} { # In the newer file dialogs, the file type widget does not even exist # if no file types specified @@ -856,7 +856,7 @@ test winDialog-5.24 {GetFileName: file types: MakeFilter() succeeds} -constraint Click cancel } return $x -} -result {0} +} -result 0 test winDialog-5.25 {GetFileName: file types: MakeFilter() succeeds} -constraints { nt } -body { @@ -867,7 +867,7 @@ test winDialog-5.25 {GetFileName: file types: MakeFilter() succeeds} -constraint Click cancel } return $x -} -result {0} +} -result 0 test winDialog-6.1 {MakeFilter} -constraints {emptyTest nt} -body {} @@ -892,7 +892,7 @@ test winDialog-9.1 {Tk_ChooseDirectoryObjCmd: no arguments} -constraints { }] # $x should be "" on a Cancel append x $y -} -result {0} +} -result 0 test winDialog-9.2 {Tk_ChooseDirectoryObjCmd: one argument} -constraints { nt } -body { @@ -907,7 +907,7 @@ test winDialog-9.3 {Tk_ChooseDirectoryObjCmd: many arguments} -constraints { then { Click cancel } -} -result {0} +} -result 0 test winDialog-9.4 {Tk_ChooseDirectoryObjCmd: Tcl_GetIndexFromObj() != TCL_OK} -constraints { nt } -body { @@ -920,7 +920,7 @@ test winDialog-9.5 {Tk_ChooseDirectoryObjCmd: Tcl_GetIndexFromObj() == TCL_OK} - then { Click cancel } -} -result {0} +} -result 0 test winDialog-9.6 {Tk_ChooseDirectoryObjCmd: valid option, but missing value} -constraints { nt } -body { diff --git a/tests/winFont.test b/tests/winFont.test index 4a394cf..f5c945d 100644 --- a/tests/winFont.test +++ b/tests/winFont.test @@ -37,12 +37,12 @@ test winfont-2.1 {TkpGetFontFromAttributes procedure: pointsize} -constraints { win } -body { expr {[font actual {-size -10} -size] > 0} -} -result {1} +} -result 1 test winfont-2.2 {TkpGetFontFromAttributes procedure: pointsize} -constraints { win } -body { expr {[font actual {-family Arial} -size] > 0} -} -result {1} +} -result 1 test winfont-2.3 {TkpGetFontFromAttributes procedure: normal weight} -constraints { win } -body { @@ -221,7 +221,7 @@ test winfont-5.5 {Tk_MeasureChars procedure: include last partial char} -constra .t.c index $t @[expr {int($cx*2.5)}],1 } -cleanup { destroy .t.c -} -result {2} +} -result 2 test winfont-5.6 {Tk_MeasureChars procedure: at least one char on line} -constraints { win @@ -337,7 +337,7 @@ test winfont-5.11 {Tk_MeasureChars procedure: check for kerning} -constraints { expr {$x < ($width*10)} } -cleanup { destroy .t.l -} -result {1} +} -result 1 test winfont-6.1 {Tk_DrawChars procedure: loop test} -constraints win -setup { @@ -375,12 +375,12 @@ test winfont-7.3 {AllocFont procedure: extract info from textmetric} -constraint win } -body { font metric {arial 10 bold italic underline overstrike} -fixed -} -result {0} +} -result 0 test winfont-7.4 {AllocFont procedure: extract info from textmetric} -constraints { win } -body { font metric systemfixed -fixed -} -result {1} +} -result 1 # cleanup cleanupTests diff --git a/tests/winSend.test b/tests/winSend.test index d4860b4..a72589f 100644 --- a/tests/winSend.test +++ b/tests/winSend.test @@ -152,7 +152,7 @@ test winSend-3.1 {TkGetInterpNames} winSend { set origLength [llength $currentInterps] set newLength [llength [winfo interps]] expr {($newLength - 2) == $origLength} -} {1} +} 1 test winSend-4.1 {DeleteProc - changing name of app} winSend { newApp a @@ -171,7 +171,7 @@ test winSend-5.1 {ExecuteRemoteObject - no error} winSend { } } list [send $interp {send [tk appname] {expr {2 / 1}}}] -} {2} +} 2 test winSend-5.2 {ExecuteRemoteObject - error} winSend { set newInterps [winfo interps] foreach interp $newInterps { @@ -268,7 +268,7 @@ test winSend-6.8 {SendDDEServer - XTYP_WILDCONNECT} winSend { } set command "dde services Tk {}" list [catch "send \{$interp\} \{$command\}"] -} {0} +} 0 test winSend-7.1 {DDEExitProc} winSend { newApp testApp @@ -312,10 +312,10 @@ test winSend-10.7 {Tk_DDEObjCmd - services wrong num args} winSend { } {1 {wrong # args: should be "dde services serviceName topicName"}} test winSend-10.8 {Tk_DDEObjCmd - null service name} winSend { list [catch {dde services {} {tktest #2}}] -} {0} +} 0 test winSend-10.9 {Tk_DDEObjCmd - null topic name} winSend { list [catch {dde services {Tk} {}}] -} {0} +} 0 test winSend-10.10 {Tk_DDEObjCmd - execute - nothing to execute} winSend { set newInterps [winfo interps] foreach interp $newInterps { diff --git a/tests/winWm.test b/tests/winWm.test index 030d11a..bfb21d1 100644 --- a/tests/winWm.test +++ b/tests/winWm.test @@ -246,7 +246,7 @@ test winWm-5.2 {UpdateGeometryInfo: menu resizing} -constraints win -setup { update set y [winfo rooty .t] lappend result [winfo height .t] - menu .t.m + menu .t.m -tearoff 1 .t configure -menu .t.m .t.m add command -label foo .t.m add command -label "thisisreallylong" @@ -275,7 +275,7 @@ test winWm-6.2 {wm attributes} -constraints win -setup { wm attributes .t -disabled } -cleanup { destroy .t -} -result {0} +} -result 0 test winWm-6.3 {wm attributes} -constraints win -setup { destroy .t } -body { diff --git a/tests/winfo.test b/tests/winfo.test index 045696d..ffacf8f 100644 --- a/tests/winfo.test +++ b/tests/winfo.test @@ -177,7 +177,7 @@ test winfo-4.7 {"winfo containing" command} -setup { expr {($x == ".") || ($x == "")} } -cleanup { destroy .t -} -result {1} +} -result 1 test winfo-5.1 {"winfo interps" command} -body { @@ -191,10 +191,10 @@ test winfo-5.3 {"winfo interps" command} -body { } -returnCodes error -result {bad window path name "geek"} test winfo-5.4 {"winfo interps" command} -constraints unix -body { expr {[lsearch -exact [winfo interps] [tk appname]] >= 0} -} -result {1} +} -result 1 test winfo-5.5 {"winfo interps" command} -constraints unix -body { expr {[lsearch -exact [winfo interps -displayof .] [tk appname]] >= 0} -} -result {1} +} -result 1 test winfo-6.1 {"winfo exists" command} -body { @@ -205,10 +205,10 @@ test winfo-6.2 {"winfo exists" command} -body { } -returnCodes error -result {wrong # args: should be "winfo exists window"} test winfo-6.3 {"winfo exists" command} -body { winfo exists gorp -} -result {0} +} -result 0 test winfo-6.4 {"winfo exists" command} -body { winfo exists . -} -result {1} +} -result 1 test winfo-6.5 {"winfo exists" command} -setup { destroy .b } -body { @@ -293,13 +293,13 @@ test winfo-9.2 {"winfo viewable" command} -body { } -returnCodes error -result {bad window path name "foo"} test winfo-9.3 {"winfo viewable" command} -body { winfo viewable . -} -result {1} +} -result 1 test winfo-9.4 {"winfo viewable" command} -constraints {failsOnUbuntu failsOnXQuarz} -body { wm iconify . winfo viewable . } -cleanup { wm deiconify . -} -result {0} +} -result 0 test winfo-9.5 {"winfo viewable" command} -setup { deleteWindows } -body { @@ -347,7 +347,7 @@ test winfo-10.2 {"winfo visualid" command} -body { } -returnCodes error -result {bad window path name "gorp"} test winfo-10.3 {"winfo visualid" command} -body { expr {2 + [winfo visualid .] - [winfo visualid .]} -} -result {2} +} -result 2 test winfo-11.1 {"winfo visualid" command} -body { @@ -361,14 +361,14 @@ test winfo-11.3 {"winfo visualid" command} -body { } -returnCodes error -result {wrong # args: should be "winfo visualsavailable window ?includeids?"} test winfo-11.4 {"winfo visualid" command} -body { llength [lindex [winfo visualsa .] 0] -} -result {2} +} -result 2 test winfo-11.5 {"winfo visualid" command} -body { llength [lindex [winfo visualsa . includeids] 0] -} -result {3} +} -result 3 test winfo-11.6 {"winfo visualid" command} -body { set x [lindex [lindex [winfo visualsa . includeids] 0] 2] expr {$x + 2 - $x} -} -result {2} +} -result 2 test winfo-12.1 {GetDisplayOf procedure} -body { diff --git a/tests/wm.test b/tests/wm.test index ee9e7fa..a300838 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -881,6 +881,7 @@ test wm-iconphoto-1.5.2 {usage} -constraints x11 -body { wm iconphoto . -default [image create photo -file {}] } -result {} + # All other iconphoto tests are platform specific @@ -1490,14 +1491,14 @@ test wm-stackorder-4.1 {wm stackorder isabove|isbelow} -body { wm stackorder . isabove .t } -cleanup { destroy .t -} -result {0} +} -result 0 test wm-stackorder-4.2 {wm stackorder isabove|isbelow} -body { toplevel .t ; update raise .t wm stackorder . isbelow .t } -cleanup { destroy .t -} -result {1} +} -result 1 test wm-stackorder-4.3 {wm stackorder isabove|isbelow} -body { toplevel .t ; update raise . @@ -1505,7 +1506,7 @@ test wm-stackorder-4.3 {wm stackorder isabove|isbelow} -body { wm stackorder .t isa . } -cleanup { destroy .t -} -result {0} +} -result 0 test wm-stackorder-4.4 {wm stackorder isabove|isbelow} -body { toplevel .t ; update raise . @@ -1513,7 +1514,7 @@ test wm-stackorder-4.4 {wm stackorder isabove|isbelow} -body { wm stackorder .t isb . } -cleanup { destroy .t -} -result {1} +} -result 1 deleteWindows test wm-stackorder-5.1 {a menu is not a toplevel} -body { @@ -2284,7 +2285,7 @@ test wm-forget-1.1 "bug #2009788: forget toplevel can cause crash" -body { winfo exists .parent.child } -cleanup { deleteWindows -} -result {1} +} -result 1 test wm-forget-1.2 "bug #2009788: forget toplevel can cause crash" -body { toplevel .parent update @@ -2293,7 +2294,7 @@ test wm-forget-1.2 "bug #2009788: forget toplevel can cause crash" -body { winfo exists .parent.child } -cleanup { deleteWindows -} -result {1} +} -result 1 test wm-forget-1.3 "bug #2009788: forget toplevel can cause crash" -body { toplevel .parent toplevel .parent.child @@ -2302,7 +2303,7 @@ test wm-forget-1.3 "bug #2009788: forget toplevel can cause crash" -body { winfo exists .parent.child } -cleanup { deleteWindows -} -result {1} +} -result 1 test wm-forget-1.4 "pack into unmapped toplevel causes crash" -body { toplevel .parent toplevel .parent.child |