diff options
Diffstat (limited to 'tests/error.test')
-rw-r--r-- | tests/error.test | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/error.test b/tests/error.test index 3773df5..0cca88f 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.11 2004/09/20 15:52:05 dgp Exp $ +# RCS: @(#) $Id: error.test,v 1.12 2004/09/30 23:06:49 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -185,6 +185,36 @@ test error-6.3 {catch must reset error state} { catch {error outer [catch set]} list $errorCode $errorInfo } {NONE 1} +test error-6.4 {catch must reset error state} { + catch {error [catch {error foo bar baz}] 1} + list $errorCode $errorInfo +} {NONE 1} +test error-6.5 {catch must reset error state} { + catch {error [catch {return -level 0 -code error -errorcode BUG}] 1} + list $errorCode $errorInfo +} {NONE 1} +test error-6.6 {catch must reset error state} { + catch {return -level 0 -code error -errorinfo [catch {error foo bar baz}]} + list $errorCode $errorInfo +} {NONE 1} +test error-6.7 {catch must reset error state} { + proc foo {} { + return -code error -errorinfo [catch {error foo bar baz}] + } + catch foo + list $errorCode +} {NONE} +test error-6.8 {catch must reset error state} { + catch {return -level 0 -code error [catch {error foo bar baz}]} + list $errorCode +} {NONE} +test error-6.9 {catch must reset error state} { + proc foo {} { + return -code error [catch {error foo bar baz}] + } + catch foo + list $errorCode +} {NONE} # cleanup catch {rename p ""} |