diff options
Diffstat (limited to 'contrib/tcl/tests/error.test')
-rw-r--r-- | contrib/tcl/tests/error.test | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/contrib/tcl/tests/error.test b/contrib/tcl/tests/error.test index 3421edc..1421e9b 100644 --- a/contrib/tcl/tests/error.test +++ b/contrib/tcl/tests/error.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# SCCS: @(#) error.test 1.18 96/11/07 18:36:09 +# SCCS: @(#) error.test 1.22 97/08/12 17:02:43 if {[string compare test [info procs test]] == 1} then {source defs} @@ -42,7 +42,7 @@ test error-1.3 {simple errors from commands} { set errorInfo } {wrong # args: should be "string compare string1 string2" while executing -"format [string compare]"} +"string compare"} test error-1.4 {simple errors from commands} { catch {error glorp} b @@ -62,6 +62,17 @@ test error-1.7 {simple errors from commands} { set b } {wrong # args: should be "catch command ?varName?"} +test error-1.8 {simple errors from commands} {nonPortable} { + # This test is non-portable: it generates a memory fault on + # machines like DEC Alphas (infinite recursion overflows + # stack?) + + proc p {} { + uplevel 1 catch p error + } + p +} 0 + # Check errors nested in procedures. Also check the optional argument # to "error" to generate a new error trace. @@ -80,7 +91,7 @@ test error-2.3 {errors in nested procedures} { } {Human-generated while executing "error {Human-generated}" - (procedure "foo" line 1) + (procedure "foo" line 4) invoked from within "foo"} @@ -98,8 +109,8 @@ test error-2.6 {errors in nested procedures} { set errorInfo } {glorp2 while executing -"format [error glorp2]" - (procedure "foo2" line 1) +"error glorp2" + (procedure "foo2" line 3) invoked from within "foo2"} @@ -160,4 +171,5 @@ test error-6.1 {catch must reset error state} { list $errorCode $errorInfo } {NONE 1} +catch {rename p ""} return "" |