diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2014-09-10 08:20:46 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2014-09-10 08:20:46 (GMT) |
commit | 186cc4a17e82ce9bd90edccc45ab943c63b40c30 (patch) | |
tree | 20cafb24aed5e93ba0a4f84880a9dbafcb17b728 /tests | |
parent | aa5429b146778774bfc447513e15c08126877653 (diff) | |
download | tcl-186cc4a17e82ce9bd90edccc45ab943c63b40c30.zip tcl-186cc4a17e82ce9bd90edccc45ab943c63b40c30.tar.gz tcl-186cc4a17e82ce9bd90edccc45ab943c63b40c30.tar.bz2 |
[2486824] Improve error message; not all that upvars is an upvar.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/upvar.test | 11 | ||||
-rw-r--r-- | tests/var.test | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/tests/upvar.test b/tests/upvar.test index 79c2d53..d18fd3b 100644 --- a/tests/upvar.test +++ b/tests/upvar.test @@ -17,7 +17,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { } testConstraint testupvar [llength [info commands testupvar]] - + test upvar-1.1 {reading variables with upvar} { proc p1 {a b} {set c 22; set d 33; p2} proc p2 {} {upvar a x1 b x2 c x3 d x4; set a abc; list $x1 $x2 $x3 $x4 $a} @@ -332,7 +332,7 @@ test upvar-8.9 {upvar won't create namespace variable that refers to procedure v unset ::test_ns_1::a } list [catch {MakeLink 1} msg] $msg -} {1 {bad variable name "a": upvar won't create namespace variable that refers to procedure variable}} +} {1 {bad variable name "a": can't create namespace variable that refers to procedure variable}} test upvar-8.10 {upvar will create element alias for new array element} { catch {unset upvarArray} array set upvarArray {} @@ -583,8 +583,11 @@ test upvar-NS-3.3 {CompileWord OBOE} -setup { } -cleanup { rename linenumber {} } -result 1 - - + # cleanup ::tcltest::cleanupTests return + +# Local Variables: +# mode: tcl +# End: diff --git a/tests/var.test b/tests/var.test index 45b7207..c852ca9 100644 --- a/tests/var.test +++ b/tests/var.test @@ -275,7 +275,7 @@ test var-3.11 {MakeUpvar, my var looks like array elem} -body { catch {unset aaaaa} set aaaaa 789789 upvar #0 aaaaa foo(bar) -} -returnCodes 1 -result {bad variable name "foo(bar)": upvar won't create a scalar variable that looks like an array element} +} -returnCodes 1 -result {bad variable name "foo(bar)": can't create a scalar variable that looks like an array element} test var-4.1 {Tcl_GetVariableName, global variable} testgetvarfullname { catch {unset a} |