summaryrefslogtreecommitdiffstats
path: root/tests/upvar.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/upvar.test')
-rw-r--r--tests/upvar.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/upvar.test b/tests/upvar.test
index d18fd3b..f41fe1b 100644
--- a/tests/upvar.test
+++ b/tests/upvar.test
@@ -298,6 +298,17 @@ test upvar-8.3 {errors in upvar command} {
proc p1 {} {upvar a b c}
list [catch p1 msg] $msg
} {1 {wrong # args: should be "upvar ?level? otherVar localVar ?otherVar localVar ...?"}}
+test upvar-8.3.1 {bad level for upvar (upvar at top-level, bug [775ee88560])} -body {
+ proc p1 {} { uplevel { upvar b b; lappend b UNEXPECTED } }
+ uplevel #0 { p1 }
+} -returnCodes error -result {bad level "1"}
+test upvar-8.3.2 {bad level for upvar (upvar at top-level, bug [775ee88560])} -setup {
+ interp create i
+} -body {
+ i eval { upvar b b; lappend b UNEXPECTED }
+} -returnCodes error -result {bad level "1"} -cleanup {
+ interp delete i
+}
test upvar-8.4 {errors in upvar command} {
proc p1 {} {upvar 0 b b}
list [catch p1 msg] $msg