diff options
author | dgp <dgp@users.sourceforge.net> | 2019-05-08 18:06:23 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2019-05-08 18:06:23 (GMT) |
commit | 5419f8e0ba508cfedb5c68a88aee618e25e17983 (patch) | |
tree | 8f0a186bd95d79185b43fa70820b8c31a790339e /tests/upvar.test | |
parent | 84f4682378d1314b5849be0f80e8e3298251c0fc (diff) | |
download | tcl-5419f8e0ba508cfedb5c68a88aee618e25e17983.zip tcl-5419f8e0ba508cfedb5c68a88aee618e25e17983.tar.gz tcl-5419f8e0ba508cfedb5c68a88aee618e25e17983.tar.bz2 |
For historical/hysterical reasons, the (unused??) public routines Tcl_UpVar()
and Tcl_UpVar2() accept random garbage for a level argument (treat it as 1)
while the [upvar] command has come to reject such values as bad levels.
Add a test to call it to our attention if we ever change that disparity
so we do so only on purpose.
Diffstat (limited to 'tests/upvar.test')
-rw-r--r-- | tests/upvar.test | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/upvar.test b/tests/upvar.test index 5ea870d..437f422 100644 --- a/tests/upvar.test +++ b/tests/upvar.test @@ -356,6 +356,10 @@ test upvar-8.11 {upvar will not create a variable that looks like an array} -set test upvar-9.1 {Tcl_UpVar2 procedure} testupvar { list [catch {testupvar xyz a {} x global} msg] $msg } {1 {bad level "xyz"}} +test upvar-9.1.1 {TclGetFrame, via Tcl_UpVar2} testupvar { + apply {{} {testupvar xyz a {} x local; set x foo}} + set a +} foo test upvar-9.2 {Tcl_UpVar2 procedure} testupvar { catch {unset a} catch {unset x} |