summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-04-04 20:51:06 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-04-04 20:51:06 (GMT)
commitf9c97ea67073aa3e2fa22b80e826b3d491e3440c (patch)
tree4629d081436796671ba3419500517e5bf2be9674 /tests/oo.test
parenta6573529e52eff368bc5f159290de355ab90ab78 (diff)
downloadtcl-f9c97ea67073aa3e2fa22b80e826b3d491e3440c.zip
tcl-f9c97ea67073aa3e2fa22b80e826b3d491e3440c.tar.gz
tcl-f9c97ea67073aa3e2fa22b80e826b3d491e3440c.tar.bz2
Fix [Bug 3514761] and related ensemble/construction problems.
Diffstat (limited to 'tests/oo.test')
-rw-r--r--tests/oo.test36
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/oo.test b/tests/oo.test
index ccea42a..8c5aeb3 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -339,7 +339,7 @@ test oo-2.6 {OO constructor and tailcall - Bug 2414858} -setup {
} -result good
test oo-2.7 {construction, method calls and ensembles - Bug 3514761} -setup {
namespace eval k {}
-} -constraints knownBug -body {
+} -body {
namespace eval k {
oo::class create s {
constructor {j} {
@@ -353,6 +353,29 @@ test oo-2.7 {construction, method calls and ensembles - Bug 3514761} -setup {
} -returnCodes error -cleanup {
namespace delete k
} -result {wrong # args: should be "k s create X j"}
+test oo-2.8 {construction, method calls and ensembles - Bug 3514761} -setup {
+ namespace eval k {}
+} -body {
+ namespace eval k {
+ oo::class create s {
+ constructor {j} {
+ # nothing
+ }
+ }
+ oo::class create t {
+ superclass s
+ constructor args {
+ k next {*}$args
+ }
+ }
+ interp alias {} ::k::next {} ::oo::Helpers::next
+ namespace export t next
+ namespace ensemble create
+ }
+ k t create X
+} -returnCodes error -cleanup {
+ namespace delete k
+} -result {wrong # args: should be "k next j"}
test oo-3.1 {basic test of OO functionality: destructor} -setup {
# This is a bit complex because it needs to run in a sub-interp as we're
@@ -1742,6 +1765,17 @@ test oo-15.8 {OO: intercept object cloning} -setup {
} -cleanup {
Foo destroy
} -result {cloned ::foo ::bar check ::foo ok check ::bar ok}
+test oo-15.9 {ensemble rewriting must not bleed through oo::copy} -setup {
+ oo::class create Foo
+} -body {
+ oo::define Foo {
+ method <cloned> {a b} {}
+ }
+ interp alias {} Bar {} oo::copy [Foo create foo]
+ Bar bar
+} -returnCodes error -cleanup {
+ Foo destroy
+} -result {wrong # args: should be "::bar <cloned> a b"}
test oo-16.1 {OO: object introspection} -body {
info object