summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-02-13 01:43:05 (GMT)
committerhobbs <hobbs>2004-02-13 01:43:05 (GMT)
commit312b7394532e2daac24f96d5be3fc2b1918cd089 (patch)
tree58a6d763f88cc6f7b9e1078e2abaf0397c91a224
parentad7029aac960220403a811dbf9e0332ed5381d05 (diff)
downloadtk-312b7394532e2daac24f96d5be3fc2b1918cd089.zip
tk-312b7394532e2daac24f96d5be3fc2b1918cd089.tar.gz
tk-312b7394532e2daac24f96d5be3fc2b1918cd089.tar.bz2
simple code cleanup
-rw-r--r--tests/window.test57
1 files changed, 12 insertions, 45 deletions
diff --git a/tests/window.test b/tests/window.test
index 51bacbc..9239914 100644
--- a/tests/window.test
+++ b/tests/window.test
@@ -5,7 +5,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: window.test,v 1.7 2002/11/14 17:30:20 mdejong Exp $
+# RCS: @(#) $Id: window.test,v 1.7.2.1 2004/02/13 01:43:05 hobbs Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -87,11 +87,7 @@ test window-2.4 {Tk_DestroyWindow, cleanup half dead window at exit} \
bind . <Destroy> exit
destroy .
} script]
- if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
- } else {
- set error 0
- }
+ set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg]
removeFile script
list $error $msg
} {0 {}}
@@ -104,11 +100,7 @@ test window-2.5 {Tk_DestroyWindow, cleanup half dead windows at exit} \
bind .t <Destroy> exit
destroy .t
} script]
- if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
- } else {
- set error 0
- }
+ set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg]
removeFile script
list $error $msg
} {0 {}}
@@ -121,11 +113,7 @@ test window-2.6 {Tk_DestroyWindow, cleanup half dead windows at exit} \
bind .t <Destroy> exit
destroy .
} script]
- if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
- } else {
- set error 0
- }
+ set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg]
removeFile script
list $error $msg
} {0 {}}
@@ -139,11 +127,7 @@ test window-2.7 {Tk_DestroyWindow, cleanup half dead windows at exit} \
bind .t.f <Destroy> exit
destroy .
} script]
- if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
- } else {
- set error 0
- }
+ set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg]
removeFile script
list $error $msg
} {0 {}}
@@ -160,17 +144,13 @@ test window-2.8 {Tk_DestroyWindow, cleanup half dead windows at exit} \
bind .t1 <Destroy> {exit 0}
destroy .t3
} script]
- if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
- } else {
- set error 0
- }
+ set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg]
removeFile script
list $error $msg
} {0 {}}
-test window-2.9 {Tk_DestroyWindow, Destroy bindings
- evaluated after exit} unixOrWin {
+test window-2.9 {Tk_DestroyWindow, Destroy bindings evaluated after exit} \
+ unixOrWin {
set script [makeFile {
toplevel .t1
toplevel .t2
@@ -179,18 +159,13 @@ test window-2.9 {Tk_DestroyWindow, Destroy bindings
bind .t1 <Destroy> {puts "Destroy .t1" ; exit 0}
destroy .t2
} script]
- if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
- } else {
- set error 0
- }
+ set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg]
removeFile script
list $error $msg
} {0 {Destroy .t2
Destroy .t1}}
-test window-2.10 {Tk_DestroyWindow, Destroy binding
- evaluated once} unixOrWin {
+test window-2.10 {Tk_DestroyWindow, Destroy binding evaluated once} unixOrWin {
set script [makeFile {
update
bind . <Destroy> {
@@ -200,11 +175,7 @@ test window-2.10 {Tk_DestroyWindow, Destroy binding
}
destroy .
} script]
- if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
- } else {
- set error 0
- }
+ set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg]
removeFile script
list $error $msg
} {0 {Destroy .}}
@@ -225,11 +196,7 @@ test window-2.11 {Tk_DestroyWindow, don't reanimate a half-dead window} \
bind .t2 <Destroy> {exit}
destroy .t2
} script]
- if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
- } else {
- set error 0
- }
+ set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg]
removeFile script
list $error $msg
} {0 YES}