diff options
author | Kevin B Kenny <kennykb@acm.org> | 2010-10-02 16:22:24 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2010-10-02 16:22:24 (GMT) |
commit | 53c93358cf3e60f1bf7b3d5756836d961007213f (patch) | |
tree | 7d0451660ada82e2fdb026ce61c363d429369b55 /tests/assemble.test | |
parent | 845f29c25c98e563d2887cbfcf16f1963ecc20bb (diff) | |
download | tcl-53c93358cf3e60f1bf7b3d5756836d961007213f.zip tcl-53c93358cf3e60f1bf7b3d5756836d961007213f.tar.gz tcl-53c93358cf3e60f1bf7b3d5756836d961007213f.tar.bz2 |
added missing tests: nsupvar, variable, upvar
Diffstat (limited to 'tests/assemble.test')
-rw-r--r-- | tests/assemble.test | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/tests/assemble.test b/tests/assemble.test index b86e728..79ac9e2 100644 --- a/tests/assemble.test +++ b/tests/assemble.test @@ -1255,7 +1255,8 @@ test assemble-10.7 {expr - noncompilable} { -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}} } -# assemble-11 - ASSEM_LVT4 (exist, existArray, dictAppend, dictLappend) +# assemble-11 - ASSEM_LVT4 (exist, existArray, dictAppend, dictLappend, +# nsupvar, variable, upvar) test assemble-11.1 {exist - wrong # args} { -body { @@ -1334,6 +1335,45 @@ test assemble-11.7 {dictLappend} { -cleanup {rename x {}} } +test assemble-11.8 {upvar} { + -body { + proc x {v} { + assemble {push 1; load v; upvar w; pop; load w} + } + proc y {} { + set z 123 + x z + } + y + } + -result 123 + -cleanup {rename x {}; rename y {}} +} + +test assemble-11.9 {nsupvar} { + -body { + namespace eval q { variable v 123 } + proc x {} { + assemble {push q; push v; nsupvar y; pop; load y} + } + x + } + -result 123 + -cleanup {namespace delete q; rename x {}} +} + +test assemble-11.10 {variable} { + -body { + namespace eval q { namespace eval r {variable v 123}} + proc x {} { + assemble {push q::r::v; variable y; load y} + } + x + } + -result 123 + -cleanup {namespace delete q; rename x {}} +} + # assemble-12 - ASSEM_LVT1 (incr and incrArray) test assemble-12.1 {incr - wrong # args} { |