diff options
author | ferrieux <ferrieux@users.sourceforge.net> | 2010-04-05 19:44:44 (GMT) |
---|---|---|
committer | ferrieux <ferrieux@users.sourceforge.net> | 2010-04-05 19:44:44 (GMT) |
commit | 068f40511f242f8ead57c0dca5f00b0eba4b6309 (patch) | |
tree | 135ba162a555a418d3cc3bc02fcec17df7d203e2 /tests/error.test | |
parent | b40d694d271c049135dd1a9c6dc276b5de177de2 (diff) | |
download | tcl-068f40511f242f8ead57c0dca5f00b0eba4b6309.zip tcl-068f40511f242f8ead57c0dca5f00b0eba4b6309.tar.gz tcl-068f40511f242f8ead57c0dca5f00b0eba4b6309.tar.bz2 |
TIP #348 IMPLEMENTATION - Substituted error stack
Diffstat (limited to 'tests/error.test')
-rw-r--r-- | tests/error.test | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/error.test b/tests/error.test index 623595c..ef09bc5 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.29 2010/03/31 10:29:22 nijtmans Exp $ +# RCS: @(#) $Id: error.test,v 1.30 2010/04/05 19:44:45 ferrieux Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -169,6 +169,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 {CALL {g 1212} CALL {f 12} UP 1} +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 {CALL {g 1212} CALL {f 12} UP 1} + # Errors in error command itself test error-5.1 {errors in error command} { @@ -223,6 +236,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 {{CALL {g 1212} CALL {f 12} UP 1} {CALL {g 1313} CALL {f 13} UP 1}} test error-7.1 {Bug 1397843} -body { variable cmds |