summaryrefslogtreecommitdiffstats
path: root/tests/cmdMZ.test
diff options
context:
space:
mode:
authorferrieux <ferrieux@users.sourceforge.net>2010-04-05 19:44:44 (GMT)
committerferrieux <ferrieux@users.sourceforge.net>2010-04-05 19:44:44 (GMT)
commit068f40511f242f8ead57c0dca5f00b0eba4b6309 (patch)
tree135ba162a555a418d3cc3bc02fcec17df7d203e2 /tests/cmdMZ.test
parentb40d694d271c049135dd1a9c6dc276b5de177de2 (diff)
downloadtcl-068f40511f242f8ead57c0dca5f00b0eba4b6309.zip
tcl-068f40511f242f8ead57c0dca5f00b0eba4b6309.tar.gz
tcl-068f40511f242f8ead57c0dca5f00b0eba4b6309.tar.bz2
TIP #348 IMPLEMENTATION - Substituted error stack
Diffstat (limited to 'tests/cmdMZ.test')
-rw-r--r--tests/cmdMZ.test12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test
index 0a86e42..c7f6e44 100644
--- a/tests/cmdMZ.test
+++ b/tests/cmdMZ.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: cmdMZ.test,v 1.29 2010/03/31 10:29:22 nijtmans Exp $
+# RCS: @(#) $Id: cmdMZ.test,v 1.30 2010/04/05 19:44:45 ferrieux Exp $
if {[catch {package require tcltest 2.1}]} {
puts stderr "Skipping tests in [info script]. tcltest 2.1 required."
@@ -149,11 +149,11 @@ test cmdMZ-return-2.8 {return option handling} -body {
test cmdMZ-return-2.9 {return option handling} -body {
return -level 0 -code 10
} -returnCodes 10 -result {}
-test cmdMZ-return-2.10 {return option handling} {
+test cmdMZ-return-2.10 {return option handling} -body {
list [catch {return -level 0 -code error} -> foo] [dictSort $foo]
-} {1 {-code 1 -errorcode NONE -errorinfo {
+} -match glob -result {1 {-code 1 -errorcode NONE -errorinfo {
while executing
-"return -level 0 -code error"} -errorline 1 -level 0}}
+"return -level 0 -code error"} -errorline 1 -errorstack * -level 0}}
test cmdMZ-return-2.11 {return option handling} {
list [catch {return -level 0 -code break} -> foo] [dictSort $foo]
} {3 {-code 3 -level 0}}
@@ -193,6 +193,9 @@ test cmdMZ-return-2.17 {return opton handling} -setup {
} -cleanup {
rename p {}
} -result {1 c {a b}}
+test cmdMZ-return-2.18 {return option handling} {
+ list [catch {return -code error -errorstack [list CALL a CALL b] yo} -> foo] [dictSort $foo] [info errorstack]
+} {2 {-code 1 -errorcode NONE -errorstack {CALL a CALL b} -level 1} {CALL a CALL b}}
# Check that the result of a [return -options $opts $result] is
# indistinguishable from that of the originally caught script, no matter what
@@ -211,6 +214,7 @@ foreach {testid script} {
cmdMZ-return-3.10 {return -code error -errorinfo foo}
cmdMZ-return-3.11 {return -code error -errorinfo foo -errorcode bar}
cmdMZ-return-3.12 {return -code error -errorinfo foo -errorcode bar -errorline 10}
+ cmdMZ-return-3.12.1 {return -code error -errorinfo foo -errorcode bar -errorline 10 -errorstack baz}
cmdMZ-return-3.13 {return -options {x y z 2}}
cmdMZ-return-3.14 {return -level 3 -code break sdf}
} {