summaryrefslogtreecommitdiffstats
path: root/tests/basic.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-02-25 23:38:14 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-02-25 23:38:14 (GMT)
commitef0b541994832ec80dd874d09c0887d2f55716aa (patch)
tree3ebec546b31e48e9389e4c0bc0a55927e5a295e6 /tests/basic.test
parent55a84d83113bfd6b1c28779a61f92ea760695a96 (diff)
downloadtcl-ef0b541994832ec80dd874d09c0887d2f55716aa.zip
tcl-ef0b541994832ec80dd874d09c0887d2f55716aa.tar.gz
tcl-ef0b541994832ec80dd874d09c0887d2f55716aa.tar.bz2
* tests/basic.test: Made several tests more robust to the
* tests/cmdMZ.test: list-quoting of path names that might * tests/exec.test: contain Tcl-special chars like { or [. * tests/io.test: Should help us sort out Tcl Bug 554068. * tests/pid.test: * tests/socket.test: * tests/source.test: * tests/unixInit.test:
Diffstat (limited to 'tests/basic.test')
-rw-r--r--tests/basic.test60
1 files changed, 34 insertions, 26 deletions
diff --git a/tests/basic.test b/tests/basic.test
index 11b7bed..c86111c 100644
--- a/tests/basic.test
+++ b/tests/basic.test
@@ -15,7 +15,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: basic.test,v 1.25.2.1 2003/05/05 16:52:33 dkf Exp $
+# RCS: @(#) $Id: basic.test,v 1.25.2.2 2004/02/25 23:38:15 dgp Exp $
#
package require tcltest 2
@@ -580,63 +580,71 @@ test basic-46.1 {Tcl_AllowExceptions: exception return not allowed} {stdio} {
DONE
}}
-test basic-46.2 {Tcl_AllowExceptions: exception return not allowed} {exec} {
+test basic-46.2 {Tcl_AllowExceptions: exception return not allowed} -setup {
set fName [makeFile {
puts hello
break
} BREAKtest]
- set res [list [catch {exec [interpreter] $fName} msg] $msg]
+} -constraints {
+ exec
+} -body {
+ exec [interpreter] $fName
+} -cleanup {
removeFile BREAKtest
- regsub {file ".*BREAKtest"} $res {file "BREAKtest"} res
- set res
-} {1 {hello
+} -returnCodes error -match glob -result {hello
invoked "break" outside of a loop
while executing
"break"
- (file "BREAKtest" line 3)}}
+ (file "*BREAKtest" line 3)}
-test basic-46.3 {Tcl_AllowExceptions: exception return not allowed} {exec} {
+test basic-46.3 {Tcl_AllowExceptions: exception return not allowed} -setup {
set fName [makeFile {
interp alias {} patch {} info patchlevel
patch
break
} BREAKtest]
- set res [list [catch {exec [interpreter] $fName} msg] $msg]
+} -constraints {
+ exec
+} -body {
+ exec [interpreter] $fName
+} -cleanup {
removeFile BREAKtest
- regsub {file ".*BREAKtest"} $res {file "BREAKtest"} res
- set res
-} {1 {invoked "break" outside of a loop
+} -returnCodes error -match glob -result {invoked "break" outside of a loop
while executing
"break"
- (file "BREAKtest" line 4)}}
+ (file "*BREAKtest" line 4)}
-test basic-46.4 {Tcl_AllowExceptions: exception return not allowed} {exec} {
+test basic-46.4 {Tcl_AllowExceptions: exception return not allowed} -setup {
set fName [makeFile {
foo [set a 1] [break]
} BREAKtest]
- set res [list [catch {exec [interpreter] $fName} msg] $msg]
+} -constraints {
+ exec
+} -body {
+ exec [interpreter] $fName
+} -cleanup {
removeFile BREAKtest
- regsub {file ".*BREAKtest"} $res {file "BREAKtest"} res
- set res
-} {1 {invoked "break" outside of a loop
+} -returnCodes error -match glob -result {invoked "break" outside of a loop
while executing
"break"
invoked from within
-"foo [set a 1] [break]"
- (file "BREAKtest" line 2)}}
+"foo \[set a 1] \[break]"
+ (file "*BREAKtest" line 2)}
-test basic-46.5 {Tcl_AllowExceptions: exception return not allowed} {exec} {
+test basic-46.5 {Tcl_AllowExceptions: exception return not allowed} -setup {
set fName [makeFile {
return -code return
} BREAKtest]
- set res [list [catch {exec [interpreter] $fName} msg] $msg]
+} -constraints {
+ exec
+} -body {
+ exec [interpreter] $fName
+} -cleanup {
removeFile BREAKtest
- regsub {file ".*BREAKtest"} $res {file "BREAKtest"} res
- set res
-} {1 {command returned bad code: 2
+} -returnCodes error -match glob -result {command returned bad code: 2
while executing
"return -code return"
- (file "BREAKtest" line 2)}}
+ (file "*BREAKtest" line 2)}
test basic-47.1 {Tcl_EvalEx: check for missing close-bracket} -body {
subst {a[set b [format cd]}