summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclVar.c9
-rw-r--r--tests/upvar.test11
-rw-r--r--tests/var.test2
3 files changed, 12 insertions, 10 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index fda5ff5..a6f6cf4 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -3605,9 +3605,8 @@ ObjMakeUpvar(
|| !HasLocalVars(varFramePtr)
|| (strstr(TclGetString(myNamePtr), "::") != NULL))) {
Tcl_AppendResult((Tcl_Interp *) iPtr, "bad variable name \"",
- TclGetString(myNamePtr), "\": upvar won't create "
- "namespace variable that refers to procedure variable",
- NULL);
+ TclGetString(myNamePtr), "\": can't create namespace "
+ "variable that refers to procedure variable", NULL);
return TCL_ERROR;
}
}
@@ -3705,8 +3704,8 @@ TclPtrObjMakeUpvar(
*/
Tcl_AppendResult((Tcl_Interp *) iPtr, "bad variable name \"",
- myName, "\": upvar won't create a scalar variable "
- "that looks like an array element", NULL);
+ myName, "\": can't create a scalar variable that "
+ "looks like an array element", NULL);
return TCL_ERROR;
}
}
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}