summaryrefslogtreecommitdiffstats
path: root/tests/error.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/error.test')
-rw-r--r--tests/error.test24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/error.test b/tests/error.test
index e18afad..1b0f0fa 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.22 2009/09/28 18:02:20 dgp Exp $
+# RCS: @(#) $Id: error.test,v 1.23 2009/11/16 17:38:09 ferrieux Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -153,6 +153,19 @@ test error-4.5 {errorInfo and errorCode variables} {
list [catch {error msg1 msg2 {}} msg] $msg $::errorInfo $::errorCode
} {1 msg1 msg2 {}}
+test error-4.6 {errorstack via info } -body {
+ proc f x {g $x$x}
+ proc g x {error G:$x}
+ catch {f 12}
+ info errorstack
+} -match glob -result {{g 1212} {f 12} {namespace eval *}}
+test error-4.7 {errorstack via options dict } -body {
+ proc f x {g $x$x}
+ proc g x {error G:$x}
+ catch {f 12} m d
+ dict get $d -errorstack
+} -match glob -result {{g 1212} {f 12} {namespace eval *}}
+
# Errors in error command itself
test error-5.1 {errors in error command} {
@@ -207,6 +220,15 @@ test error-6.9 {catch must reset error state} {
catch foo
list $::errorCode
} {NONE}
+test error-6.10 {catch must reset errorstack} -body {
+ proc f x {g $x$x}
+ proc g x {error G:$x}
+ catch {f 12}
+ set e1 [info errorstack]
+ catch {f 13}
+ set e2 [info errorstack]
+ list $e1 $e2
+} -match glob -result {{{g 1212} {f 12} {namespace eval *}} {{g 1313} {f 13} {namespace eval *}}}
test error-7.1 {Bug 1397843} -body {
variable cmds