diff options
Diffstat (limited to 'tests/lreplace.test')
| -rw-r--r-- | tests/lreplace.test | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/lreplace.test b/tests/lreplace.test index 0aed5d5..5f675bc 100644 --- a/tests/lreplace.test +++ b/tests/lreplace.test @@ -6,13 +6,15 @@ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994 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: lreplace.test,v 1.2 1998/09/14 18:40:11 stanton Exp $ -if {[string compare test [info procs test]] == 1} then {source defs} +if {[lsearch [namespace children] ::tcltest] == -1} { + package require tcltest + namespace import -force ::tcltest::* +} test lreplace-1.1 {lreplace command} { lreplace {1 2 3 4 5} 0 0 a @@ -100,19 +102,19 @@ test lreplace-1.26 {lreplace command} { test lreplace-2.1 {lreplace errors} { list [catch lreplace msg] $msg -} {1 {wrong # args: should be "lreplace list first last ?element element ...?"}} +} {1 {wrong # args: should be "lreplace list first last ?element ...?"}} test lreplace-2.2 {lreplace errors} { list [catch {lreplace a b} msg] $msg -} {1 {wrong # args: should be "lreplace list first last ?element element ...?"}} +} {1 {wrong # args: should be "lreplace list first last ?element ...?"}} test lreplace-2.3 {lreplace errors} { list [catch {lreplace x a 10} msg] $msg -} {1 {bad index "a": must be integer or "end"}} +} {1 {bad index "a": must be integer?[+-]integer? or end?[+-]integer?}} test lreplace-2.4 {lreplace errors} { list [catch {lreplace x 10 x} msg] $msg -} {1 {bad index "x": must be integer or "end"}} +} {1 {bad index "x": must be integer?[+-]integer? or end?[+-]integer?}} test lreplace-2.5 {lreplace errors} { list [catch {lreplace x 10 1x} msg] $msg -} {1 {bad index "1x": must be integer or "end"}} +} {1 {bad index "1x": must be integer?[+-]integer? or end?[+-]integer?}} test lreplace-2.6 {lreplace errors} { list [catch {lreplace x 3 2} msg] $msg } {1 {list doesn't contain element 3}} @@ -128,4 +130,7 @@ test lreplace-3.1 {lreplace won't modify shared argument objects} { p } "a b c" +# cleanup catch {unset foo} +::tcltest::cleanupTests +return |
