diff options
author | hobbs <hobbs> | 2004-02-13 01:43:05 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2004-02-13 01:43:05 (GMT) |
commit | 0b4c0fa7390351fb221ff5a0938a0ed5133aea4e (patch) | |
tree | 58a6d763f88cc6f7b9e1078e2abaf0397c91a224 /tests/window.test | |
parent | 881343742c1b45a5d5c2322f37be1103d6d66c8e (diff) | |
download | tk-0b4c0fa7390351fb221ff5a0938a0ed5133aea4e.zip tk-0b4c0fa7390351fb221ff5a0938a0ed5133aea4e.tar.gz tk-0b4c0fa7390351fb221ff5a0938a0ed5133aea4e.tar.bz2 |
simple code cleanup
Diffstat (limited to 'tests/window.test')
-rw-r--r-- | tests/window.test | 57 |
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} |