diff options
Diffstat (limited to 'tests/event.test')
-rw-r--r-- | tests/event.test | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/tests/event.test b/tests/event.test index 4278ba7..0cf627b 100644 --- a/tests/event.test +++ b/tests/event.test @@ -9,19 +9,14 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: event.test,v 1.19 2002/07/05 10:38:42 dkf Exp $ +# RCS: @(#) $Id: event.test,v 1.20 2002/07/10 11:56:44 dgp Exp $ -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest 2 - namespace import -force ::tcltest::* -} +package require tcltest 2 +namespace import -force ::tcltest::* -::tcltest::testConstraint testfilehandler \ - [expr {[info commands testfilehandler] != {}}] -::tcltest::testConstraint testexithandler \ - [expr {[info commands testexithandler] != {}}] -::tcltest::testConstraint testfilewait \ - [expr {[info commands testfilewait] != {}}] +testConstraint testfilehandler [llength [info commands testfilehandler]] +testConstraint testexithandler [llength [info commands testexithandler]] +testConstraint testfilewait [llength [info commands testfilewait]] test event-1.1 {Tcl_CreateFileHandler, reading} {testfilehandler} { testfilehandler close @@ -286,7 +281,7 @@ test event-7.5 {correct behaviour when there is no bgerror [Bug 219142]} {exec} vwait a } - list [catch {exec [info nameofexecutable] << $script} errMsg] $errMsg + list [catch {exec [interpreter] << $script} errMsg] $errMsg } {1 {hello while executing "error hello" @@ -305,7 +300,7 @@ catch {rename bgerror {}} test event-8.1 {Tcl_CreateExitHandler procedure} {stdio testexithandler} { - set child [open |[list [info nameofexecutable]] r+] + set child [open |[list [interpreter]] r+] puts $child "testexithandler create 41; testexithandler create 4" puts $child "testexithandler create 6; exit" flush $child @@ -318,7 +313,7 @@ odd 41 } test event-9.1 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} { - set child [open |[list [info nameofexecutable]] r+] + set child [open |[list [interpreter]] r+] puts $child "testexithandler create 41; testexithandler create 4" puts $child "testexithandler create 6; testexithandler delete 41" puts $child "testexithandler create 16; exit" @@ -331,7 +326,7 @@ even 6 even 4 } test event-9.2 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} { - set child [open |[list [info nameofexecutable]] r+] + set child [open |[list [interpreter]] r+] puts $child "testexithandler create 41; testexithandler create 4" puts $child "testexithandler create 6; testexithandler delete 4" puts $child "testexithandler create 16; exit" @@ -344,7 +339,7 @@ even 6 odd 41 } test event-9.3 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} { - set child [open |[list [info nameofexecutable]] r+] + set child [open |[list [interpreter]] r+] puts $child "testexithandler create 41; testexithandler create 4" puts $child "testexithandler create 6; testexithandler delete 6" puts $child "testexithandler create 16; exit" @@ -357,7 +352,7 @@ even 4 odd 41 } test event-9.4 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} { - set child [open |[list [info nameofexecutable]] r+] + set child [open |[list [interpreter]] r+] puts $child "testexithandler create 41; testexithandler delete 41" puts $child "testexithandler create 16; exit" flush $child @@ -368,7 +363,7 @@ test event-9.4 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} { } test event-10.1 {Tcl_Exit procedure} {stdio} { - set child [open |[list [info nameofexecutable]] r+] + set child [open |[list [interpreter]] r+] puts $child "exit 3" list [catch {close $child} msg] $msg [lindex $errorCode 0] \ [lindex $errorCode 2] |