diff options
author | dgp <dgp@users.sourceforge.net> | 2013-09-19 19:10:47 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-09-19 19:10:47 (GMT) |
commit | a245f07a2892cd66869f871243657d5c6e8dc18a (patch) | |
tree | 213a81a2fc74da8da222ea16aa4cd15fd6660e6f /tests/upvar.test | |
parent | 55cdf82568fd98037b9400977a5026f6d777318e (diff) | |
parent | f19c90364c590451e85ba125933b3aa1fd9acd20 (diff) | |
download | tcl-a245f07a2892cd66869f871243657d5c6e8dc18a.zip tcl-a245f07a2892cd66869f871243657d5c6e8dc18a.tar.gz tcl-a245f07a2892cd66869f871243657d5c6e8dc18a.tar.bz2 |
merge trunk; update changes
Diffstat (limited to 'tests/upvar.test')
-rw-r--r-- | tests/upvar.test | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/upvar.test b/tests/upvar.test index e2c9ffd..e93f58a 100644 --- a/tests/upvar.test +++ b/tests/upvar.test @@ -414,6 +414,17 @@ test upvar-9.7 {Tcl_UpVar procedure} testupvar { } {1234} catch {unset a} +test upvar-10.1 {CompileWord OBOE} -setup { + proc linenumber {} {dict get [info frame -1] line} +} -body { + apply {n { + upvar 1 {*}{ + } [return [incr n -[linenumber]]] x + }} [linenumber] +} -cleanup { + rename linenumber {} +} -result 1 + # # Tests for 'namespace upvar'. As the implementation is essentially the same as # for 'upvar', we only test that the variables are linked correctly, i.e., we @@ -536,6 +547,38 @@ test upvar-NS-2.2 {TIP 323} -setup { } -cleanup { namespace delete test_ns_1 } -result {} + +test upvar-NS-3.1 {CompileWord OBOE} -setup { + proc linenumber {} {dict get [info frame -1] line} +} -body { + apply {n { + namespace upvar {*}{ + } [return [incr n -[linenumber]]] x y + }} [linenumber] +} -cleanup { + rename linenumber {} +} -result 1 +test upvar-NS-3.2 {CompileWord OBOE} -setup { + proc linenumber {} {dict get [info frame -1] line} +} -body { + apply {n { + namespace upvar :: {*}{ + } [return [incr n -[linenumber]]] x + }} [linenumber] +} -cleanup { + rename linenumber {} +} -result 1 +test upvar-NS-3.3 {CompileWord OBOE} -setup { + proc linenumber {} {dict get [info frame -1] line} +} -body { + apply {n { + variable x {*}{ + } [return [incr n -[linenumber]]] + }} [linenumber] +} -cleanup { + rename linenumber {} +} -result 1 + # cleanup ::tcltest::cleanupTests |