summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-09-28 16:34:39 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-09-28 16:34:39 (GMT)
commitbf83bf5f46a2ec5105fac6f5a25b43535dcac49f (patch)
tree6984f745e20f497e9b6bc4ad51f85f7c9a7ec69b /tests
parent46de449b25360bf9fc69f9e2acfc177db7dd7ee6 (diff)
downloadtcl-bf83bf5f46a2ec5105fac6f5a25b43535dcac49f.zip
tcl-bf83bf5f46a2ec5105fac6f5a25b43535dcac49f.tar.gz
tcl-bf83bf5f46a2ec5105fac6f5a25b43535dcac49f.tar.bz2
* tests/error.test (error-15.9.*): More coverage tests for [try].
Test error-15.9.3.0.0 covers [Bug 2855247].
Diffstat (limited to 'tests')
-rw-r--r--tests/error.test13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/error.test b/tests/error.test
index 334ba29..3106ca9 100644
--- a/tests/error.test
+++ b/tests/error.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: error.test,v 1.20 2009/09/28 03:22:04 dgp Exp $
+# RCS: @(#) $Id: error.test,v 1.21 2009/09/28 16:34:40 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -491,19 +491,28 @@ test error-15.7 {try with no matching handler (unknown integer result propagates
try { return -level 0 -code 123456 } trap {} {} { list a b c }
} -returnCodes 123456 -result {}
-foreach level {0 1 2} {
+foreach level {0 1 2 3} {
foreach code {0 1 2 3 4 5} {
# Following cases have different -errorinfo; avoid false alarms
if {$level == 0 && $code == 1} continue
foreach extras {{} {-bar soom}} {
+
test error-15.8.$level.$code.[llength $extras] {[try] coverage} {
set script {return -level $level -code $code {*}$extras foo}
catch $script m1 o1
catch {try $script} m2 o2
expr {$o1 eq $o2 ? "ok" : "$o1\n\tis not equal to\n$o2"}
} ok
+
+test error-15.9.$level.$code.[llength $extras] {[try] coverage} {
+ set script {return -level $level -code $code {*}$extras foo}
+ catch $script m1 o1
+ catch {try $script finally {}} m2 o2
+ expr {$o1 eq $o2 ? "ok" : "$o1\n\tis not equal to\n$o2"}
+} ok
+
}
}
}