diff options
Diffstat (limited to 'tests/set.test')
-rw-r--r-- | tests/set.test | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/set.test b/tests/set.test index 47a90d7..ce1d31a 100644 --- a/tests/set.test +++ b/tests/set.test @@ -10,10 +10,10 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: set.test,v 1.8 2000/04/10 17:19:04 ericm Exp $ +# RCS: @(#) $Id: set.test,v 1.9 2004/11/03 17:16:05 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest + package require tcltest 2 namespace import -force ::tcltest::* } @@ -247,13 +247,14 @@ test set-2.3 {set command: runtime error, errors in reading variables} { set a(6) 44 list [catch {set a(18)} msg] $msg } {1 {can't read "a(18)": no such element in array}} -test set-2.4 {set command: runtime error, readonly variable} { +test set-2.4 {set command: runtime error, readonly variable} -body { proc readonly args {error "variable is read-only"} set x 123 trace var x w readonly list [catch {set x 1} msg] $msg $errorInfo -} {1 {can't set "x": variable is read-only} {can't set "x": variable is read-only +} -match glob -result {1 {can't set "x": variable is read-only} {*variable is read-only while executing +* "set x 1"}} test set-2.5 {set command: runtime error, basic array operations} { list [catch {set a(other)} msg] $msg @@ -492,14 +493,15 @@ test set-4.3 {uncompiled set command: runtime error, errors in reading variables $z a(6) 44 list [catch {$z a(18)} msg] $msg } {1 {can't read "a(18)": no such element in array}} -test set-4.4 {uncompiled set command: runtime error, readonly variable} { +test set-4.4 {uncompiled set command: runtime error, readonly variable} -body { set z set proc readonly args {error "variable is read-only"} $z x 123 trace var x w readonly list [catch {$z x 1} msg] $msg $errorInfo -} {1 {can't set "x": variable is read-only} {can't set "x": variable is read-only +} -match glob -result {1 {can't set "x": variable is read-only} {*variable is read-only while executing +* "$z x 1"}} test set-4.5 {uncompiled set command: runtime error, basic array operations} { set z set |