diff options
author | dgp <dgp@users.sourceforge.net> | 2017-06-26 19:22:29 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2017-06-26 19:22:29 (GMT) |
commit | c9a0c6154c53dac75feb2af5e5cacce15bf25b11 (patch) | |
tree | 0a89b0c488355cfedec38b203299ba311e5fee65 /tests/oo.test | |
parent | 6e375012383167dfecb749feba6af252ebcf3692 (diff) | |
parent | 40560f53a7756617375dab14d8499406ba3a92b4 (diff) | |
download | tcl-c9a0c6154c53dac75feb2af5e5cacce15bf25b11.zip tcl-c9a0c6154c53dac75feb2af5e5cacce15bf25b11.tar.gz tcl-c9a0c6154c53dac75feb2af5e5cacce15bf25b11.tar.bz2 |
merge 8.6
Diffstat (limited to 'tests/oo.test')
-rw-r--r-- | tests/oo.test | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test index cb37a76..5eaa8bf 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -2013,6 +2013,41 @@ test oo-15.10 {variable binding must not bleed through oo::copy} -setup { } -cleanup { FooClass destroy } -result {foo bar grill bar} +test oo-15.11 {OO: object cloning} -returnCodes error -body { + oo::copy +} -result {wrong # args: should be "oo::copy sourceName ?targetName? ?targetNamespace?"} +test oo-15.12 {OO: object cloning with target NS} -setup { + oo::class create Super + oo::class create Cls {superclass Super} +} -body { + namespace eval ::existing {} + oo::copy Cls {} ::existing +} -returnCodes error -cleanup { + Super destroy + catch {namespace delete ::existing} +} -result {::existing refers to an existing namespace} +test oo-15.13 {OO: object cloning with target NS} -setup { + oo::class create Super + oo::class create Cls {superclass Super} +} -body { + list [namespace exist ::dupens] [oo::copy Cls Cls2 ::dupens] [namespace exist ::dupens] +} -cleanup { + Super destroy +} -result {0 ::Cls2 1} +test oo-15.14 {OO: object cloning with target NS} -setup { + oo::class create Cls {export eval} + set result {} +} -body { + Cls create obj + obj eval { + proc test-15.14 {} {} + } + lappend result [info commands ::dupens::t*] + oo::copy obj obj2 ::dupens + lappend result [info commands ::dupens::t*] +} -cleanup { + Cls destroy +} -result {{} ::dupens::test-15.14} test oo-16.1 {OO: object introspection} -body { info object |