diff options
author | rjohnson <rjohnson> | 1998-04-01 09:51:44 (GMT) |
---|---|---|
committer | rjohnson <rjohnson> | 1998-04-01 09:51:44 (GMT) |
commit | 066ea7fd88d49cb456f74da71dbe875e4fc0aabb (patch) | |
tree | 8fb30cb152c4dc191be47fa043d2e6f5ea38c7ba /tests/cmds.test | |
parent | 13242623d2ff3ea02ab6a62bfb48a7dbb5c27e22 (diff) | |
download | tk-066ea7fd88d49cb456f74da71dbe875e4fc0aabb.zip tk-066ea7fd88d49cb456f74da71dbe875e4fc0aabb.tar.gz tk-066ea7fd88d49cb456f74da71dbe875e4fc0aabb.tar.bz2 |
Initial revision
Diffstat (limited to 'tests/cmds.test')
-rw-r--r-- | tests/cmds.test | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/cmds.test b/tests/cmds.test new file mode 100644 index 0000000..71b14f4 --- /dev/null +++ b/tests/cmds.test @@ -0,0 +1,43 @@ +# This file is a Tcl script to test the procedures in the file +# tkCmds.c. It is organized in the standard fashion for Tcl tests. +# +# Copyright (c) 1996 Sun Microsystems, Inc. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# SCCS: @(#) cmds.test 1.1 96/03/14 13:25:24 + +if {[string compare test [info procs test]] == 1} { + source defs +} + +eval destroy [winfo child .] +wm geometry . {} +update + +test cmds-1.1 {tkwait visibility, argument errors} { + list [catch {tkwait visibility} msg] $msg +} {1 {wrong # args: should be "tkwait variable|visibility|window name"}} +test cmds-1.2 {tkwait visibility, argument errors} { + list [catch {tkwait visibility foo bar} msg] $msg +} {1 {wrong # args: should be "tkwait variable|visibility|window name"}} +test cmds-1.3 {tkwait visibility, argument errors} { + list [catch {tkwait visibility bad_window} msg] $msg +} {1 {bad window path name "bad_window"}} +test cmds-1.4 {tkwait visibility, waiting for window to be mapped} { + button .b -text "Test" + set x init + after 100 {set x delay; place .b -x 0 -y 0} + tkwait visibility .b + destroy .b + set x +} {delay} +test cmds-1.5 {tkwait visibility, window gets deleted} { + frame .f + button .f.b -text "Test" + pack .f.b + set x init + after 100 {set x deleted; destroy .f} + list [catch {tkwait visibility .f.b} msg] $msg $x +} {1 {window ".f.b" was deleted before its visibility changed} deleted} |