diff options
Diffstat (limited to 'tcl/tests/error.test')
-rw-r--r-- | tcl/tests/error.test | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/tcl/tests/error.test b/tcl/tests/error.test index df8bb608f0d..6b2e5e302f1 100644 --- a/tcl/tests/error.test +++ b/tcl/tests/error.test @@ -6,13 +6,17 @@ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. +# Copyright (c) 1998-1999 by Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id$ -if {[string compare test [info procs test]] == 1} then {source defs} +if {[lsearch [namespace children] ::tcltest] == -1} { + package require tcltest + namespace import -force ::tcltest::* +} proc foo {} { global errorInfo @@ -29,20 +33,20 @@ proc foo2 {} { # Catch errors occurring in commands and errors from "error" command test error-1.1 {simple errors from commands} { - catch {format [string compare]} b + catch {format [string index]} b } 1 test error-1.2 {simple errors from commands} { - catch {format [string compare]} b + catch {format [string index]} b set b -} {wrong # args: should be "string compare string1 string2"} +} {wrong # args: should be "string index string charIndex"} test error-1.3 {simple errors from commands} { - catch {format [string compare]} b + catch {format [string index]} b set errorInfo -} {wrong # args: should be "string compare string1 string2" +} {wrong # args: should be "string index string charIndex" while executing -"string compare"} +"string index"} test error-1.4 {simple errors from commands} { catch {error glorp} b @@ -171,5 +175,8 @@ test error-6.1 {catch must reset error state} { list $errorCode $errorInfo } {NONE 1} +# cleanup catch {rename p ""} -return "" +::tcltest::cleanupTests +return + |