summaryrefslogtreecommitdiffstats
path: root/tests/wm.test
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2005-02-09 09:32:25 (GMT)
committerdkf <dkf@noemail.net>2005-02-09 09:32:25 (GMT)
commit0dbda4ee9dea4a43fee0f375a3308d8aba57397a (patch)
tree1b413e96198776ce5825314c3ab4caac5639f343 /tests/wm.test
parent563d9480fdd85fab5712db27c6d807b92699a8ee (diff)
downloadtk-0dbda4ee9dea4a43fee0f375a3308d8aba57397a.zip
tk-0dbda4ee9dea4a43fee0f375a3308d8aba57397a.tar.gz
tk-0dbda4ee9dea4a43fee0f375a3308d8aba57397a.tar.bz2
Tidy up coding style (better grouping of related tests)
FossilOrigin-Name: ec83248e2f017fe67641e1ea93ccd3d9b7fae7cb
Diffstat (limited to 'tests/wm.test')
-rw-r--r--tests/wm.test224
1 files changed, 39 insertions, 185 deletions
diff --git a/tests/wm.test b/tests/wm.test
index e3c5c92..44cb429 100644
--- a/tests/wm.test
+++ b/tests/wm.test
@@ -7,7 +7,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: wm.test,v 1.30 2004/10/29 22:28:30 mdejong Exp $
+# RCS: @(#) $Id: wm.test,v 1.31 2005/02/09 09:32:26 dkf Exp $
# This file tests window manager interactions that work across
# platforms. Window manager tests that only work on a specific
@@ -45,19 +45,15 @@ stdWindow
test wm-1.1 {Tk_WmObjCmd procedure, miscellaneous errors} {
list [catch {wm} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-1.2 {Tk_WmObjCmd procedure, miscellaneous errors} {
list [catch {wm foo} msg] $msg
} {1 {bad option "foo": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconphoto, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
-
test wm-1.3 {Tk_WmObjCmd procedure, miscellaneous errors} {
list [catch {wm command} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-1.4 {Tk_WmObjCmd procedure, miscellaneous errors} {
list [catch {wm aspect bogus} msg] $msg
} {1 {bad window path name "bogus"}}
-
test wm-1.5 {Tk_WmObjCmd procedure, miscellaneous errors} {
catch {destroy .b}
button .b -text hello
@@ -65,50 +61,40 @@ test wm-1.5 {Tk_WmObjCmd procedure, miscellaneous errors} {
} {1 {window ".b" isn't a top-level window}}
+### wm aspect ###
test wm-aspect-1.1 {usage} {
list [catch {wm aspect} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-aspect-1.2 {usage} {
list [catch {wm aspect . _} err] $err
} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}}
-
test wm-aspect-1.3 {usage} {
list [catch {wm aspect . _ _ _} err] $err
} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}}
-
test wm-aspect-1.4 {usage} {
list [catch {wm aspect . _ _ _ _ _} err] $err
} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}}
-
test wm-aspect-1.5 {usage} {
list [catch {wm aspect . bad 14 15 16} msg] $msg
} {1 {expected integer but got "bad"}}
-
test wm-aspect-1.6 {usage} {
list [catch {wm aspect . 13 foo 15 16} msg] $msg
} {1 {expected integer but got "foo"}}
-
test wm-aspect-1.7 {usage} {
list [catch {wm aspect . 13 14 bar 16} msg] $msg
} {1 {expected integer but got "bar"}}
-
test wm-aspect-1.8 {usage} {
list [catch {wm aspect . 13 14 15 baz} msg] $msg
} {1 {expected integer but got "baz"}}
-
test wm-aspect-1.9 {usage} {
list [catch {wm aspect . 0 14 15 16} msg] $msg
} {1 {aspect number can't be <= 0}}
-
test wm-aspect-1.10 {usage} {
list [catch {wm aspect . 13 0 15 16} msg] $msg
} {1 {aspect number can't be <= 0}}
-
test wm-aspect-1.11 {usage} {
list [catch {wm aspect . 13 14 0 16} msg] $msg
} {1 {aspect number can't be <= 0}}
-
test wm-aspect-1.12 {usage} {
list [catch {wm aspect . 13 14 15 0} msg] $msg
} {1 {aspect number can't be <= 0}}
@@ -123,31 +109,28 @@ test wm-aspect-2.1 {setting and reading values} {
} [list {} {3 4 10 2} {}]
+### wm attributes ###
test wm-attributes-1.1 {usage} {
list [catch {wm attributes} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-attributes-1.2.1 {usage} win {
list [catch {wm attributes . _} err] $err
} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
-
test wm-attributes-1.2.2 {usage} win {
list [catch {wm attributes . -alpha 1.0 -disabled} err] $err
} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
-
test wm-attributes-1.2.3 {usage} win {
list [catch {wm attributes . -to} err] $err
} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
-
test wm-attributes-1.2.4 {usage} unix {
list [catch {wm attributes . _} err] $err
} {1 {wrong # args: should be "wm attributes window"}}
+### wm client ###
test wm-client-1.1 {usage} {
list [catch {wm client} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-client-1.2 {usage} {
list [catch {wm client . _ _} err] $err
} {1 {wrong # args: should be "wm client window ?name?"}}
@@ -162,18 +145,16 @@ test wm-client-2.1 {setting and reading values} {
} [list {} Miffo {}]
+### wm colormapwindows ###
test wm-colormapwindows-1.1 {usage} {
list [catch {wm colormapwindows} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-colormapwindows-1.2 {usage} {
list [catch {wm colormapwindows . _ _} err] $err
} {1 {wrong # args: should be "wm colormapwindows window ?windowList?"}}
-
test wm-colormapwindows-1.3 {usage} {
list [catch {wm colormapwindows . "a \{"} msg] $msg
} {1 {unmatched open brace in list}}
-
test wm-colormapwindows-1.4 {usage} {
list [catch {wm colormapwindows . foo} msg] $msg
} {1 {bad window path name "foo"}}
@@ -192,7 +173,6 @@ test wm-colormapwindows-2.1 {reading values} {
update
list $x [wm colormapwindows .t2]
} {{.t2.b .t2} {.t2.b .t2.c .t2}}
-
test wm-colormapwindows-2.2 {setting and reading values} {
catch {destroy .t2}
toplevel .t2 -width 200 -height 200
@@ -206,14 +186,13 @@ test wm-colormapwindows-2.2 {setting and reading values} {
} {.t2.b .t2.a}
+### wm command ###
test wm-command-1.1 {usage} {
list [catch {wm command} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-command-1.2 {usage} {
list [catch {wm command . _ _} err] $err
} {1 {wrong # args: should be "wm command window ?value?"}}
-
test wm-command-1.3 {usage} {
list [catch {wm command . "a \{"} msg] $msg
} {1 {unmatched open brace in list}}
@@ -228,18 +207,16 @@ test wm-command-2.1 {setting and reading values} {
} [list {} [list Miffo Foo] {}]
+### wm deiconify ###
test wm-deiconify-1.1 {usage} {
list [catch {wm deiconify} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-deiconify-1.2 {usage} {
list [catch {wm deiconify . _} err] $err
} {1 {wrong # args: should be "wm deiconify window"}}
-
test wm-deiconify-1.3 {usage} {
list [catch {wm deiconify _} err] $err
} {1 {bad window path name "_"}}
-
test wm-deiconify-1.4 {usage} {
catch {destroy .icon}
toplevel .icon -width 50 -height 50 -bg red
@@ -248,7 +225,6 @@ test wm-deiconify-1.4 {usage} {
destroy .icon
set result
} {1 {can't deiconify .icon: it is an icon for .t}}
-
test wm-deiconify-1.5 {usage} {
catch {destroy .embed}
frame .t.f -container 1
@@ -265,7 +241,6 @@ test wm-deiconify-2.1 {a window that has never been mapped
wm deiconify .t
winfo ismapped .t
} 0
-
test wm-deiconify-2.2 {a window that has already been
mapped should be mapped by deiconify} {
deleteWindows
@@ -275,7 +250,6 @@ test wm-deiconify-2.2 {a window that has already been
wm deiconify .t
winfo ismapped .t
} 1
-
test wm-deiconify-2.3 {geometry for an unmapped window
should not be calculated by a call to deiconify,
it should be done at idle time} {
@@ -289,7 +263,6 @@ test wm-deiconify-2.3 {geometry for an unmapped window
lappend results [lindex [split \
[wm geometry .t] +] 0]
} {1x1+0+0 1x1+0+0 200x200}
-
test wm-deiconify-2.4 {invoking destroy after a deiconify
should not result in a crash because of a callback
set on the toplevel} {
@@ -302,14 +275,13 @@ test wm-deiconify-2.4 {invoking destroy after a deiconify
} {}
+### wm focusmodel ###
test wm-focusmodel-1.1 {usage} {
list [catch {wm focusmodel} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-focusmodel-1.2 {usage} {
list [catch {wm focusmodel . _ _} err] $err
} {1 {wrong # args: should be "wm focusmodel window ?active|passive?"}}
-
test wm-focusmodel-1.3 {usage} {
list [catch {wm focusmodel . bogus} msg] $msg
} {1 {bad argument "bogus": must be active or passive}}
@@ -327,23 +299,22 @@ test wm-focusmodel-2.1 {setting and reading values} {
} {passive active passive}
+### wm frame ###
test wm-frame-1.1 {usage} {
list [catch {wm frame} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-frame-1.2 {usage} {
list [catch {wm frame . _} err] $err
} {1 {wrong # args: should be "wm frame window"}}
+### wm geometry ###
test wm-geometry-1.1 {usage} {
list [catch {wm geometry} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-geometry-1.2 {usage} {
list [catch {wm geometry . _ _} err] $err
} {1 {wrong # args: should be "wm geometry window ?newGeometry?"}}
-
test wm-geometry-1.3 {usage} {
list [catch {wm geometry . bogus} msg] $msg
} {1 {bad geometry specifier "bogus"}}
@@ -359,50 +330,40 @@ test wm-geometry-2.1 {setting values} {
} [list 150x150+50+50 0]
+### wm grid ###
test wm-grid-1.1 {usage} {
list [catch {wm grid} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-grid-1.2 {usage} {
list [catch {wm grid . _} err] $err
} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}}
-
test wm-grid-1.3 {usage} {
list [catch {wm grid . _ _ _} err] $err
} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}}
-
test wm-grid-1.4 {usage} {
list [catch {wm grid . _ _ _ _ _} err] $err
} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}}
-
test wm-grid-1.5 {usage} {
list [catch {wm grid . bad 14 15 16} msg] $msg
} {1 {expected integer but got "bad"}}
-
test wm-grid-1.6 {usage} {
list [catch {wm grid . 13 foo 15 16} msg] $msg
} {1 {expected integer but got "foo"}}
-
test wm-grid-1.7 {usage} {
list [catch {wm grid . 13 14 bar 16} msg] $msg
} {1 {expected integer but got "bar"}}
-
test wm-grid-1.8 {usage} {
list [catch {wm grid . 13 14 15 baz} msg] $msg
} {1 {expected integer but got "baz"}}
-
test wm-grid-1.9 {usage} {
list [catch {wm grid . -1 14 15 16} msg] $msg
} {1 {baseWidth can't be < 0}}
-
test wm-grid-1.10 {usage} {
list [catch {wm grid . 13 -1 15 16} msg] $msg
} {1 {baseHeight can't be < 0}}
-
test wm-grid-1.11 {usage} {
list [catch {wm grid . 13 14 -1 16} msg] $msg
} {1 {widthInc can't be <= 0}}
-
test wm-grid-1.12 {usage} {
list [catch {wm grid . 13 14 15 -1} msg] $msg
} {1 {heightInc can't be <= 0}}
@@ -417,14 +378,13 @@ test wm-grid-2.1 {setting and reading values} {
} [list {} {3 4 10 2} {}]
+### wm group ###
test wm-group-1.1 {usage} {
list [catch {wm group} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-group-1.2 {usage} {
list [catch {wm group .t 12 13} msg] $msg
} {1 {wrong # args: should be "wm group window ?pathName?"}}
-
test wm-group-1.3 {usage} {
list [catch {wm group .t bogus} msg] $msg
} {1 {bad window path name "bogus"}}
@@ -439,22 +399,19 @@ test wm-group-2.1 {setting and reading values} {
} [list {} . {}]
+### wm iconbitmap ###
test wm-iconbitmap-1.1 {usage} {
list [catch {wm iconbitmap} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-iconbitmap-1.2.1 {usage} unix {
list [catch {wm iconbitmap .t 12 13} msg] $msg
} {1 {wrong # args: should be "wm iconbitmap window ?bitmap?"}}
-
test wm-iconbitmap-1.2.2 {usage} win {
list [catch {wm iconbitmap .t 12 13 14} msg] $msg
} {1 {wrong # args: should be "wm iconbitmap window ?-default? ?image?"}}
-
test wm-iconbitmap-1.3 {usage} win {
list [catch {wm iconbitmap .t 12 13} msg] $msg
} {1 {illegal option "12" must be "-default"}}
-
test wm-iconbitmap-1.4 {usage} {
list [catch {wm iconbitmap .t bad-bitmap} msg] $msg
} {1 {bitmap "bad-bitmap" not defined}}
@@ -469,10 +426,10 @@ test wm-iconbitmap-2.1 {setting and reading values} {
} [list {} hourglass {}]
+### wm iconify ###
test wm-iconify-1.1 {usage} {
list [catch {wm iconify} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-iconify-1.2 {usage} {
list [catch {wm iconify .t _} msg] $msg
} {1 {wrong # args: should be "wm iconify window"}}
@@ -485,7 +442,6 @@ test wm-iconify-2.1 {Misc errors} {
destroy .t2
set result
} {1 {can't iconify ".t2": override-redirect flag is set}}
-
test wm-iconify-2.2 {Misc errors} {
catch {destroy .t2}
toplevel .t2
@@ -495,7 +451,6 @@ test wm-iconify-2.2 {Misc errors} {
destroy .t2
set result
} {1 {can't iconify ".t2": it is a transient}}
-
test wm-iconify-2.3 {Misc errors} {
catch {destroy .t2}
toplevel .t2
@@ -505,7 +460,6 @@ test wm-iconify-2.3 {Misc errors} {
destroy .t2
set result
} {1 {can't iconify .t2: it is an icon for .t}}
-
test wm-iconify-2.4 {Misc errors} {
catch {destroy .t2}
frame .t.f -container 1
@@ -529,14 +483,13 @@ test wm-iconify-3.1 {} {
} {1 0}
+### wm iconmask ###
test wm-iconmask-1.1 {usage} {
list [catch {wm iconmask} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-iconmask-1.2 {usage} {
list [catch {wm iconmask .t 12 13} msg] $msg
} {1 {wrong # args: should be "wm iconmask window ?bitmap?"}}
-
test wm-iconmask-1.3 {usage} {
list [catch {wm iconmask .t bad-bitmap} msg] $msg
} {1 {bitmap "bad-bitmap" not defined}}
@@ -551,10 +504,10 @@ test wm-iconmask-2.1 {setting and reading values} {
} [list {} hourglass {}]
+### wm iconname ###
test wm-iconname-1.1 {usage} {
list [catch {wm iconname} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-iconname-1.2 {usage} {
list [catch {wm iconname .t 12 13} msg] $msg
} {1 {wrong # args: should be "wm iconname window ?newName?"}}
@@ -569,10 +522,10 @@ test wm-iconname-2.1 {setting and reading values} {
} [list {} ThisIconHasAName {}]
+### wm iconphoto ###
test wm-iconphoto-1.1 {usage} {
list [catch {wm iconphoto} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-iconphoto-1.2 {usage} {
list [catch {wm iconphoto .} msg] $msg
} {1 {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"}}
@@ -586,22 +539,20 @@ test wm-iconphoto-1.4 {usage} {
# All other iconphoto tests are platform specific
+
+### wm iconposition ###
test wm-iconposition-1.1 {usage} {
list [catch {wm iconposition} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-iconposition-1.2 {usage} {
list [catch {wm iconposition .t 12} msg] $msg
} {1 {wrong # args: should be "wm iconposition window ?x y?"}}
-
test wm-iconposition-1.3 {usage} {
list [catch {wm iconposition .t 12 13 14} msg] $msg
} {1 {wrong # args: should be "wm iconposition window ?x y?"}}
-
test wm-iconposition-1.4 {usage} {
list [catch {wm iconposition .t bad 13} msg] $msg
} {1 {expected integer but got "bad"}}
-
test wm-iconposition-1.5 {usage} {
list [catch {wm iconposition .t 13 lousy} msg] $msg
} {1 {expected integer but got "lousy"}}
@@ -616,18 +567,16 @@ test wm-iconposition-2.1 {setting and reading values} {
} [list {} {10 20} {}]
+### wm iconwindow ###
test wm-iconwindow-1.1 {usage} {
list [catch {wm iconwindow} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-iconwindow-1.2 {usage} {
list [catch {wm iconwindow .t 12 13} msg] $msg
} {1 {wrong # args: should be "wm iconwindow window ?pathName?"}}
-
test wm-iconwindow-1.3 {usage} {
list [catch {wm iconwindow .t bogus} msg] $msg
} {1 {bad window path name "bogus"}}
-
test wm-iconwindow-1.4 {usage} {
catch {destroy .b}
button .b -text Help
@@ -635,7 +584,6 @@ test wm-iconwindow-1.4 {usage} {
destroy .b
set result
} {1 {can't use .b as icon window: not at top level}}
-
test wm-iconwindow-1.5 {usage} {
catch {destroy .icon}
toplevel .icon -width 50 -height 50 -bg green
@@ -662,26 +610,22 @@ test wm-iconwindow-2.1 {setting and reading values} {
} [list {} .icon {}]
+### wm maxsize ###
test wm-maxsize-1.1 {usage} {
list [catch {wm maxsize} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-maxsize-1.2 {usage} {
list [catch {wm maxsize . a} msg] $msg
} {1 {wrong # args: should be "wm maxsize window ?width height?"}}
-
test wm-maxsize-1.3 {usage} {
list [catch {wm maxsize . a b c} msg] $msg
} {1 {wrong # args: should be "wm maxsize window ?width height?"}}
-
test wm-maxsize-1.4 {usage} {
list [catch {wm maxsize . x 100} msg] $msg
} {1 {expected integer but got "x"}}
-
test wm-maxsize-1.5 {usage} {
list [catch {wm maxsize . 100 bogus} msg] $msg
} {1 {expected integer but got "bogus"}}
-
test wm-maxsize-1.6 {usage} {
catch {destroy .t2}
toplevel .t2
@@ -690,7 +634,6 @@ test wm-maxsize-1.6 {usage} {
destroy .t2
set result
} {300 200}
-
test wm-maxsize-1.7 {maxsize must be <= screen size} {
destroy .t
toplevel .t
@@ -710,7 +653,6 @@ test wm-maxsize-2.1 {setting the maxsize to a value smaller
update
lrange [split [wm geom .t] x+] 0 1
} {200 150}
-
test wm-maxsize-2.2 {setting the maxsize to a value smaller
than the current size will resize a gridded toplevel} {
destroy .t
@@ -723,7 +665,6 @@ test wm-maxsize-2.2 {setting the maxsize to a value smaller
update
lrange [split [wm geom .t] x+] 0 1
} {4 3}
-
test wm-maxsize-2.3 {attempting to resize to a value
bigger than the current maxsize will
set it to the max size} {
@@ -735,7 +676,6 @@ test wm-maxsize-2.3 {attempting to resize to a value
update
lrange [split [wm geom .t] x+] 0 1
} {300 250}
-
test wm-maxsize-2.4 {attempting to resize to a value
bigger than the current maxsize will
set it to the max size when gridded} {
@@ -749,7 +689,6 @@ test wm-maxsize-2.4 {attempting to resize to a value
update
lrange [split [wm geom .t] x+] 0 1
} {6 5}
-
test wm-maxsize-2.5 {Use max size if window size is not
explicitly set and the reqWidth/reqHeight are
bigger than the max size} {
@@ -764,26 +703,23 @@ test wm-maxsize-2.5 {Use max size if window size is not
list $req [lrange [split [wm geom .t] x+] 0 1]
} {{400 400} {300 300}}
+
+### wm minsize ###
test wm-minsize-1.1 {usage} {
list [catch {wm minsize} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-minsize-1.2 {usage} {
list [catch {wm minsize . a} msg] $msg
} {1 {wrong # args: should be "wm minsize window ?width height?"}}
-
test wm-minsize-1.3 {usage} {
list [catch {wm minsize . a b c} msg] $msg
} {1 {wrong # args: should be "wm minsize window ?width height?"}}
-
test wm-minsize-1.4 {usage} {
list [catch {wm minsize . x 100} msg] $msg
} {1 {expected integer but got "x"}}
-
test wm-minsize-1.5 {usage} {
list [catch {wm minsize . 100 bogus} msg] $msg
} {1 {expected integer but got "bogus"}}
-
test wm-minsize-1.6 {usage} {
catch {destroy .t2}
toplevel .t2
@@ -803,7 +739,6 @@ test wm-minsize-2.1 {setting the minsize to a value larger
update
lrange [split [wm geom .t] x+] 0 1
} {400 300}
-
test wm-minsize-2.2 {setting the minsize to a value larger
than the current size will resize a gridded toplevel} {
destroy .t
@@ -816,7 +751,6 @@ test wm-minsize-2.2 {setting the minsize to a value larger
update
lrange [split [wm geom .t] x+] 0 1
} {8 8}
-
test wm-minsize-2.3 {attempting to resize to a value
smaller than the current minsize will set
it to the minsize} {
@@ -828,7 +762,6 @@ test wm-minsize-2.3 {attempting to resize to a value
update
lrange [split [wm geom .t] x+] 0 1
} {300 300}
-
test wm-minsize-2.4 {attempting to resize to a value
smaller than the current minsize will set
it to the minsize when gridded} {
@@ -842,7 +775,6 @@ test wm-minsize-2.4 {attempting to resize to a value
update
lrange [split [wm geom .t] x+] 0 1
} {6 6}
-
test wm-minsize-2.5 {Use min size if window size is not
explicitly set and the reqWidth/reqHeight are
smaller than the min size} {
@@ -857,14 +789,14 @@ test wm-minsize-2.5 {Use min size if window size is not
list $req [lrange [split [wm geom .t] x+] 0 1]
} {{250 250} {300 300}}
+
+### wm overrideredirect ###
test wm-overrideredirect-1.1 {usage} {
list [catch {wm overrideredirect} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-overrideredirect-1.2 {usage} {
list [catch {wm overrideredirect .t 1 2} msg] $msg
} {1 {wrong # args: should be "wm overrideredirect window ?boolean?"}}
-
test wm-overrideredirect-1.3 {usage} {
list [catch {wm overrideredirect .t boo} msg] $msg
} {1 {expected boolean value but got "boo"}}
@@ -879,14 +811,13 @@ test wm-overrideredirect-2.1 {setting and reading values} {
} {0 1 0}
+### wm positionfrom ###
test wm-positionfrom-1.1 {usage} {
list [catch {wm positionfrom} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-positionfrom-1.2 {usage} {
list [catch {wm positionfrom .t 1 2} msg] $msg
} {1 {wrong # args: should be "wm positionfrom window ?user/program?"}}
-
test wm-positionfrom-1.3 {usage} {
list [catch {wm positionfrom .t none} msg] $msg
} {1 {bad argument "none": must be program or user}}
@@ -906,10 +837,10 @@ test wm-positionfrom-2.1 {setting and reading values} {
} {user program {}}
+### wm protocol ###
test wm-protocol-1.1 {usage} {
list [catch {wm protocol} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-protocol-1.2 {usage} {
list [catch {wm protocol .t 1 2 3} msg] $msg
} {1 {wrong # args: should be "wm protocol window ?name? ?command?"}}
@@ -922,7 +853,6 @@ test wm-protocol-2.1 {setting and reading values} {
wm protocol .t bar {}
set result
} {bar {foo a}}
-
test wm-protocol-2.2 {setting and reading values} {
set result {}
wm protocol .t foo {a b c}
@@ -932,7 +862,6 @@ test wm-protocol-2.2 {setting and reading values} {
wm protocol .t bar {}
lappend result [wm protocol .t foo] [wm protocol .t bar]
} {{a b c} {test script for bar} {} {}}
-
test wm-protocol-2.3 {setting and reading values} {
wm protocol .t foo {a b c}
wm protocol .t foo {test script}
@@ -942,22 +871,19 @@ test wm-protocol-2.3 {setting and reading values} {
} {test script}
+### wm resizable ###
test wm-resizable-1.1 {usage} {
list [catch {wm resizable} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-resizable-1.2 {usage} {
list [catch {wm resizable .t 1} msg] $msg
} {1 {wrong # args: should be "wm resizable window ?width height?"}}
-
test wm-resizable-1.3 {usage} {
list [catch {wm resizable .t 1 2 3} msg] $msg
} {1 {wrong # args: should be "wm resizable window ?width height?"}}
-
test wm-resizable-1.4 {usage} {
list [catch {wm resizable .t bad 0} msg] $msg
} {1 {expected boolean value but got "bad"}}
-
test wm-resizable-1.5 {usage} {
list [catch {wm resizable .t 1 bad} msg] $msg
} {1 {expected boolean value but got "bad"}}
@@ -972,14 +898,13 @@ test wm-resizable-2.1 {setting and reading values} {
} {0 1 {1 0} {1 1}}
+### wm sizefrom ###
test wm-sizefrom-1.1 {usage} {
list [catch {wm sizefrom} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-sizefrom-1.2 {usage} {
list [catch {wm sizefrom .t 1 2} msg] $msg
} {1 {wrong # args: should be "wm sizefrom window ?user|program?"}}
-
test wm-sizefrom-1.4 {usage} {
list [catch {wm sizefrom .t bad} msg] $msg
} {1 {bad argument "bad": must be program or user}}
@@ -995,38 +920,31 @@ test wm-sizefrom-2.1 {setting and reading values} {
} {{} user program {}}
-
+### wm stackorder ###
test wm-stackorder-1.1 {usage} {
list [catch {wm stackorder} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-stackorder-1.2 {usage} {
list [catch {wm stackorder . _} err] $err
} {1 {wrong # args: should be "wm stackorder window ?isabove|isbelow window?"}}
-
test wm-stackorder-1.3 {usage} {
list [catch {wm stackorder . _ _ _} err] $err
} {1 {wrong # args: should be "wm stackorder window ?isabove|isbelow window?"}}
-
test wm-stackorder-1.4 {usage} {
list [catch {wm stackorder . is .} err] $err
} {1 {ambiguous argument "is": must be isabove or isbelow}}
-
test wm-stackorder-1.5 {usage} {
list [catch {wm stackorder _} err] $err
} {1 {bad window path name "_"}}
-
test wm-stackorder-1.6 {usage} {
list [catch {wm stackorder . isabove _} err] $err
} {1 {bad window path name "_"}}
-
test wm-stackorder-1.7 {usage} {
catch {destroy .t}
toplevel .t
button .t.b
list [catch {wm stackorder .t.b} err] $err
} {1 {window ".t.b" isn't a top-level window}}
-
test wm-stackorder-1.8 {usage} {
catch {destroy .t}
toplevel .t
@@ -1035,7 +953,6 @@ test wm-stackorder-1.8 {usage} {
update
list [catch {wm stackorder . isabove .t.b} err] $err
} {1 {window ".t.b" isn't a top-level window}}
-
test wm-stackorder-1.9 {usage} {
catch {destroy .t}
toplevel .t
@@ -1044,31 +961,25 @@ test wm-stackorder-1.9 {usage} {
update
list [catch {wm stackorder . isbelow .t.b} err] $err
} {1 {window ".t.b" isn't a top-level window}}
-
test wm-stackorder-1.10 {usage, isabove|isbelow toplevels must be mapped} {
catch {destroy .t}
toplevel .t ; update
wm withdraw .t
list [catch {wm stackorder .t isabove .} err] $err
} {1 {window ".t" isn't mapped}}
-
test wm-stackorder-1.11 {usage, isabove|isbelow toplevels must be mapped} {
catch {destroy .t}
toplevel .t ; update
wm withdraw .t
list [catch {wm stackorder . isbelow .t} err] $err
} {1 {window ".t" isn't mapped}}
-
-
deleteWindows
-
test wm-stackorder-2.1 {} {
catch {destroy .t}
toplevel .t ; update
wm stackorder .
} {. .t}
-
test wm-stackorder-2.2 {} {
catch {destroy .t}
toplevel .t ; update
@@ -1076,7 +987,6 @@ test wm-stackorder-2.2 {} {
raiseDelay
wm stackorder .
} {.t .}
-
test wm-stackorder-2.3 {} {
catch {destroy .t}
toplevel .t ; update
@@ -1087,7 +997,6 @@ test wm-stackorder-2.3 {} {
raiseDelay
wm stackorder .
} {.t . .t2}
-
test wm-stackorder-2.4 {} {
catch {destroy .t}
toplevel .t ; update
@@ -1098,7 +1007,6 @@ test wm-stackorder-2.4 {} {
raiseDelay
wm stackorder .
} {.t2 .t .}
-
test wm-stackorder-2.5 {} {
catch {destroy .parent}
toplevel .parent ; update
@@ -1113,9 +1021,7 @@ test wm-stackorder-2.5 {} {
raiseDelay
wm stackorder .parent
} {.parent.child2 .parent.child1 .parent}
-
deleteWindows
-
test wm-stackorder-2.6 {non-toplevel widgets ignored} {
catch {destroy .t1}
toplevel .t1
@@ -1124,16 +1030,12 @@ test wm-stackorder-2.6 {non-toplevel widgets ignored} {
update
wm stackorder .
} {. .t1}
-
deleteWindows
-
test wm-stackorder-2.7 {no children returns self} {
wm stackorder .
} {.}
-
deleteWindows
-
test wm-stackorder-3.1 {unmapped toplevel} {
catch {destroy .t1}
toplevel .t1 ; update
@@ -1142,7 +1044,6 @@ test wm-stackorder-3.1 {unmapped toplevel} {
wm iconify .t1
wm stackorder .
} {. .t2}
-
test wm-stackorder-3.2 {unmapped toplevel} {
catch {destroy .t1}
toplevel .t1 ; update
@@ -1151,7 +1052,6 @@ test wm-stackorder-3.2 {unmapped toplevel} {
wm withdraw .t2
wm stackorder .
} {. .t1}
-
test wm-stackorder-3.3 {unmapped toplevel} {
catch {destroy .t1}
toplevel .t1 ; update
@@ -1160,7 +1060,6 @@ test wm-stackorder-3.3 {unmapped toplevel} {
wm withdraw .t2
wm stackorder .t2
} {}
-
test wm-stackorder-3.4 {unmapped toplevel} {
catch {destroy .t1}
toplevel .t1 ; update
@@ -1168,7 +1067,6 @@ test wm-stackorder-3.4 {unmapped toplevel} {
wm withdraw .t1.t2
wm stackorder .t1
} {.t1}
-
test wm-stackorder-3.5 {unmapped toplevel} {
catch {destroy .t1}
toplevel .t1 ; update
@@ -1176,7 +1074,6 @@ test wm-stackorder-3.5 {unmapped toplevel} {
wm withdraw .t1
wm stackorder .t1
} {.t1.t2}
-
test wm-stackorder-3.6 {unmapped toplevel} {
catch {destroy .t1}
toplevel .t1 ; update
@@ -1185,7 +1082,6 @@ test wm-stackorder-3.6 {unmapped toplevel} {
wm withdraw .t1.t2
wm stackorder .t1
} {.t1 .t1.t2.t3}
-
test wm-stackorder-3.7 {unmapped toplevel, mapped children returned} {
catch {destroy .t1}
toplevel .t1 ; update
@@ -1193,31 +1089,25 @@ test wm-stackorder-3.7 {unmapped toplevel, mapped children returned} {
wm withdraw .t1
wm stackorder .t1
} {.t1.t2}
-
test wm-stackorder-3.8 {toplevel mapped in idle callback } {
catch {destroy .t1}
toplevel .t1
wm stackorder .
} {.}
-
-
deleteWindows
-
test wm-stackorder-4.1 {wm stackorder isabove|isbelow} {
catch {destroy .t}
toplevel .t ; update
raise .t
wm stackorder . isabove .t
} {0}
-
test wm-stackorder-4.2 {wm stackorder isabove|isbelow} {
catch {destroy .t}
toplevel .t ; update
raise .t
wm stackorder . isbelow .t
} {1}
-
test wm-stackorder-4.3 {wm stackorder isabove|isbelow} {
catch {destroy .t}
toplevel .t ; update
@@ -1225,7 +1115,6 @@ test wm-stackorder-4.3 {wm stackorder isabove|isbelow} {
raiseDelay
wm stackorder .t isa .
} {0}
-
test wm-stackorder-4.4 {wm stackorder isabove|isbelow} {
catch {destroy .t}
toplevel .t ; update
@@ -1233,7 +1122,6 @@ test wm-stackorder-4.4 {wm stackorder isabove|isbelow} {
raiseDelay
wm stackorder .t isb .
} {1}
-
deleteWindows
test wm-stackorder-5.1 {a menu is not a toplevel} {
@@ -1247,7 +1135,6 @@ test wm-stackorder-5.1 {a menu is not a toplevel} {
raiseDelay
wm stackorder .
} {.t .}
-
test wm-stackorder-5.2 {A normal toplevel can't be
raised above an overrideredirect toplevel } {
catch {destroy .t}
@@ -1258,7 +1145,6 @@ test wm-stackorder-5.2 {A normal toplevel can't be
raiseDelay
wm stackorder . isabove .t
} 0
-
test wm-stackorder-5.3 {An overrideredirect window
can be explicitly lowered } {
catch {destroy .t}
@@ -1281,10 +1167,11 @@ test wm-stackorder-6.1 {An embedded toplevel does not
stdWindow
+
+### wm title ###
test wm-title-1.1 {usage} {
list [catch {wm title} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-title-1.2 {usage} {
list [catch {wm title . 1 2} msg] $msg
} {1 {wrong # args: should be "wm title window ?newTitle?"}}
@@ -1300,21 +1187,19 @@ test wm-title-2.1 {setting and reading values} {
} {t Apa {}}
+### wm transient ###
test wm-transient-1.1 {usage} {
catch {destroy .t} ; toplevel .t
list [catch {wm transient .t 1 2} msg] $msg
} {1 {wrong # args: should be "wm transient window ?master?"}}
-
test wm-transient-1.2 {usage} {
catch {destroy .t} ; toplevel .t
list [catch {wm transient .t foo} msg] $msg
} {1 {bad window path name "foo"}}
-
test wm-transient-1.3 {usage} {
catch {destroy .t} ; toplevel .t
list [catch {wm transient foo .t} msg] $msg
} {1 {bad window path name "foo"}}
-
test wm-transient-1.4 {usage} {
deleteWindows
toplevel .master
@@ -1322,7 +1207,6 @@ test wm-transient-1.4 {usage} {
wm transient .subject .master
list [catch {wm iconify .subject} msg] $msg
} {1 {can't iconify ".subject": it is a transient}}
-
test wm-transient-1.5 {usage} {
deleteWindows
toplevel .icon -bg blue
@@ -1331,7 +1215,6 @@ test wm-transient-1.5 {usage} {
toplevel .dummy
list [catch {wm transient .icon .dummy} msg] $msg
} {1 {can't make ".icon" a transient: it is an icon for .top}}
-
test wm-transient-1.6 {usage} {
deleteWindows
toplevel .icon -bg blue
@@ -1340,13 +1223,11 @@ test wm-transient-1.6 {usage} {
toplevel .dummy
list [catch {wm transient .dummy .icon} msg] $msg
} {1 {can't make ".icon" a master: it is an icon for .top}}
-
test wm-transient-1.7 {usage} {
deleteWindows
toplevel .master
list [catch {wm transient .master .master} err] $err
} {1 {can't make ".master" its own master}}
-
test wm-transient-1.8 {usage} {
deleteWindows
toplevel .master
@@ -1366,7 +1247,6 @@ test wm-transient-2.1 { basic get/set of master } {
lappend results [wm transient .subject]
set results
} {{} .master {}}
-
test wm-transient-2.2 { first toplevel parent of
non-toplevel master is used } {
deleteWindows
@@ -1388,7 +1268,6 @@ test wm-transient-3.1 { transient toplevel is withdrawn
update
list [wm state .subject] [winfo ismapped .subject]
} {withdrawn 0}
-
test wm-transient-3.2 { already mapped transient toplevel
takes on withdrawn state of master } {
deleteWindows
@@ -1401,7 +1280,6 @@ test wm-transient-3.2 { already mapped transient toplevel
update
list [wm state .subject] [winfo ismapped .subject]
} {withdrawn 0}
-
test wm-transient-3.3 { withdraw/deiconify on the master
also does a withdraw/deiconify on the transient } {
deleteWindows
@@ -1432,7 +1310,6 @@ test wm-transient-4.1 { transient toplevel is withdrawn
update
list [wm state .subject] [winfo ismapped .subject]
} {withdrawn 0}
-
test wm-transient-4.2 { already mapped transient toplevel
is withdrawn if master is iconic } {
deleteWindows
@@ -1445,7 +1322,6 @@ test wm-transient-4.2 { already mapped transient toplevel
update
list [wm state .subject] [winfo ismapped .subject]
} {withdrawn 0}
-
test wm-transient-4.3 { iconify/deiconify on the master
does a withdraw/deiconify on the transient } {
deleteWindows
@@ -1483,7 +1359,6 @@ test wm-transient-5.1 { an error during transient command should not
lappend results [wm state .subject]
set results
} {1 withdrawn normal}
-
test wm-transient-5.2 { remove transient property when master
is destroyed } {
deleteWindows
@@ -1495,7 +1370,6 @@ test wm-transient-5.2 { remove transient property when master
update
wm transient .subject
} {}
-
test wm-transient-5.3 { remove transient property from window
that had never been mapped when master is destroyed } {
deleteWindows
@@ -1520,7 +1394,6 @@ test wm-transient-6.1 { a withdrawn transient does not track
update
wm state .subject
} {withdrawn}
-
test wm-transient-6.2 { a withdrawn transient does not track
state changes in the master } {
set results [list]
@@ -1544,7 +1417,6 @@ test wm-transient-6.2 { a withdrawn transient does not track
update
lappend results [wm state .subject]
} {withdrawn normal withdrawn normal}
-
test wm-transient-6.3 { a withdrawn transient does not track
state changes in the master } {
deleteWindows
@@ -1574,7 +1446,6 @@ test wm-transient-7.1 {Destroying transient} {
destroy .t
# OK: the above did not cause a panic.
} {}
-
test wm-transient-7.2 {Destroying master} {
deleteWindows
toplevel .t
@@ -1585,7 +1456,6 @@ test wm-transient-7.2 {Destroying master} {
destroy .transient
set result
} {}
-
test wm-transient-7.3 {Reassign transient, destroy old master} {
deleteWindows
toplevel .t1
@@ -1597,7 +1467,6 @@ test wm-transient-7.3 {Reassign transient, destroy old master} {
destroy .t2
destroy .transient
} {}
-
test wm-transient-7.4 {Reassign transient, destroy new master} {
deleteWindows
toplevel .t1
@@ -1609,7 +1478,6 @@ test wm-transient-7.4 {Reassign transient, destroy new master} {
destroy .t1
destroy .transient
} {}
-
test wm-transient-7.5 {Reassign transient, destroy transient} {
deleteWindows
toplevel .t1
@@ -1622,10 +1490,11 @@ test wm-transient-7.5 {Reassign transient, destroy transient} {
destroy .t1 ;# so did this
} {}
+
+### wm state ###
test wm-state-1.1 {usage} {
list [catch {wm state} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-state-1.2 {usage} {
list [catch {wm state . _ _} err] $err
} {1 {wrong # args: should be "wm state window ?state?"}}
@@ -1635,21 +1504,18 @@ test wm-state-2.1 {initial state} {
toplevel .t
wm state .t
} {normal}
-
test wm-state-2.2 {state change before map} {
deleteWindows
toplevel .t
wm state .t withdrawn
wm state .t
} {withdrawn}
-
test wm-state-2.3 {state change before map} {
deleteWindows
toplevel .t
wm withdraw .t
wm state .t
} {withdrawn}
-
test wm-state-2.4 {state change after map} {
deleteWindows
toplevel .t
@@ -1657,7 +1523,6 @@ test wm-state-2.4 {state change after map} {
wm state .t withdrawn
wm state .t
} {withdrawn}
-
test wm-state-2.5 {state change after map} {
deleteWindows
toplevel .t
@@ -1665,21 +1530,18 @@ test wm-state-2.5 {state change after map} {
wm withdraw .t
wm state .t
} {withdrawn}
-
test wm-state-2.6 {state change before map} {
deleteWindows
toplevel .t
wm state .t iconic
wm state .t
} {iconic}
-
test wm-state-2.7 {state change before map} {
deleteWindows
toplevel .t
wm iconify .t
wm state .t
} {iconic}
-
test wm-state-2.8 {state change after map} {
deleteWindows
toplevel .t
@@ -1687,7 +1549,6 @@ test wm-state-2.8 {state change after map} {
wm state .t iconic
wm state .t
} {iconic}
-
test wm-state-2.9 {state change after map} {
deleteWindows
toplevel .t
@@ -1695,7 +1556,6 @@ test wm-state-2.9 {state change after map} {
wm iconify .t
wm state .t
} {iconic}
-
test wm-state-2.10 {state change before map} {
deleteWindows
toplevel .t
@@ -1703,7 +1563,6 @@ test wm-state-2.10 {state change before map} {
wm state .t normal
wm state .t
} {normal}
-
test wm-state-2.11 {state change before map} {
deleteWindows
toplevel .t
@@ -1711,7 +1570,6 @@ test wm-state-2.11 {state change before map} {
wm deiconify .t
wm state .t
} {normal}
-
test wm-state-2.12 {state change after map} {
deleteWindows
toplevel .t
@@ -1720,7 +1578,6 @@ test wm-state-2.12 {state change after map} {
wm state .t normal
wm state .t
} {normal}
-
test wm-state-2.13 {state change after map} {
deleteWindows
toplevel .t
@@ -1729,7 +1586,6 @@ test wm-state-2.13 {state change after map} {
wm deiconify .t
wm state .t
} {normal}
-
test wm-state-2.14 {state change before map} {
deleteWindows
toplevel .t
@@ -1737,7 +1593,6 @@ test wm-state-2.14 {state change before map} {
wm state .t normal
wm state .t
} {normal}
-
test wm-state-2.15 {state change before map} {
deleteWindows
toplevel .t
@@ -1745,7 +1600,6 @@ test wm-state-2.15 {state change before map} {
wm deiconify .t
wm state .t
} {normal}
-
test wm-state-2.16 {state change after map} {
deleteWindows
toplevel .t
@@ -1754,7 +1608,6 @@ test wm-state-2.16 {state change after map} {
wm state .t normal
wm state .t
} {normal}
-
test wm-state-2.17 {state change after map} {
deleteWindows
toplevel .t
@@ -1763,7 +1616,6 @@ test wm-state-2.17 {state change after map} {
wm deiconify .t
wm state .t
} {normal}
-
test wm-state-2.18 {state change after map} win {
deleteWindows
toplevel .t
@@ -1772,10 +1624,11 @@ test wm-state-2.18 {state change after map} win {
wm state .t
} {zoomed}
+
+### wm withdraw ###
test wm-withdraw-1.1 {usage} {
list [catch {wm withdraw} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-
test wm-withdraw-1.2 {usage} {
list [catch {wm withdraw . _} msg] $msg
} {1 {wrong # args: should be "wm withdraw window"}}
@@ -1799,6 +1652,8 @@ test wm-withdraw-3.1 {} {
lappend result [wm state .t] [winfo ismapped .t]
} {withdrawn 0 normal 1}
+
+### Misc. wm tests ###
test wm-deletion-epoch-1.1 {Deletion epoch on multiple displays} {altDisplay} {
# See Tk Bug #671330 "segfault when e.g. deiconifying destroyed window"
deleteWindows
@@ -1814,7 +1669,6 @@ test wm-deletion-epoch-1.1 {Deletion epoch on multiple displays} {altDisplay} {
# if the window was raised after a button click for example.
# This sort of testing may not be possible.
-
deleteWindows
cleanupTests
return