diff options
Diffstat (limited to 'tests/winSend.test')
-rw-r--r-- | tests/winSend.test | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/tests/winSend.test b/tests/winSend.test index d95e102..089ea85 100644 --- a/tests/winSend.test +++ b/tests/winSend.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: winSend.test,v 1.5 2003/04/01 21:07:02 dgp Exp $ +# RCS: @(#) $Id: winSend.test,v 1.6 2004/05/23 17:34:50 dkf Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -36,27 +36,32 @@ proc newApp {name {safe {}}} { } set currentInterps [winfo interps] -if {[testConstraint win] && [llength [info commands send]]} { +if { + [testConstraint win] && + [llength [info commands send]] && + [catch {exec [interpreter] &}] == 0 +} then { + # Wait until the child application has launched. + while {[llength [winfo interps]] == [llength $currentInterps]} {} - if {[catch {exec [interpreter] &}] == 0} { - - # Wait until the child application has launched. - while {[llength [winfo interps]] == [llength $currentInterps]} {} - - # Now find an interp to send to - set newInterps [winfo interps] - foreach interp $newInterps { - if {[lsearch -exact $currentInterps $interp] < 0} { - break - } + # Now find an interp to send to + set newInterps [winfo interps] + foreach interp $newInterps { + if {[lsearch -exact $currentInterps $interp] < 0} { + break } - - # Now we have found our interpreter we are going to send to. - # Make sure that it works first. - testConstraint winSend [expr {[catch { - send $interp {console hide; update} - }] == 0}] } + + # Now we have found our interpreter we are going to send to. + # Make sure that it works first. + testConstraint winSend [expr {![catch { + send $interp { + console hide + update + } + }]}] +} else { + testConstraint winSend 0 } # setting up dde server is done when the first interp is created and @@ -65,9 +70,7 @@ test winSend-1.1 {Tk_SetAppName - changing name of interp} winSend { newApp testApp list [testApp eval tk appname testApp2] [interp delete testApp] } {testApp2 {}} -test winSend-1.2 {Tk_SetAppName - changing name - not front of linked list} { - winSend -} { +test winSend-1.2 {Tk_SetAppName - changing name - not front of linked list} winSend { newApp testApp newApp testApp2 list [testApp eval tk appname testApp3] [interp delete testApp] [interp delete testApp2] @@ -404,4 +407,3 @@ while {[llength $newInterps] != [llength $currentInterps]} { # cleanup cleanupTests return - |