summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2015-05-17 12:06:31 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2015-05-17 12:06:31 (GMT)
commit8dbd1a22e6d1fa309234b477a35d4e52cedb6042 (patch)
tree52b18dda3785c1c4f1cf704dac4459b5e0f1d8e4
parent88ba7f5ecd76402c51024948cb375b2a8855a05d (diff)
downloadtcl-8dbd1a22e6d1fa309234b477a35d4e52cedb6042.zip
tcl-8dbd1a22e6d1fa309234b477a35d4e52cedb6042.tar.gz
tcl-8dbd1a22e6d1fa309234b477a35d4e52cedb6042.tar.bz2
[ad6696285c] Demonstrate that filters are not called for destructors.
-rw-r--r--tests/oo.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test
index 22e6cfb..f35b70a 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -1569,6 +1569,34 @@ test oo-12.7 {OO: filters} -setup {
} -cleanup {
Aclass destroy
} -result {foo {{::Aclass outerfoo} {::Aclass InnerFoo}}}
+test oo-12.8 {OO: filters and destructors} -setup {
+ oo::class create Aclass
+ Aclass create Aobject
+ set ::log {}
+} -body {
+ oo::define Aclass {
+ constructor {} {
+ lappend ::log "in constructor"
+ }
+ destructor {
+ lappend ::log "in destructor"
+ }
+ method bar {} {
+ lappend ::log "in method"
+ }
+ method Boo args {
+ lappend ::log [self target]
+ next {*}$args
+ }
+ filter Boo
+ }
+ set obj [Aclass new]
+ $obj bar
+ $obj destroy
+ return $::log
+} -cleanup {
+ Aclass destroy
+} -result {{in constructor} {::Aclass bar} {in method} {::oo::object destroy} {in destructor}}
test oo-13.1 {OO: changing an object's class} {
oo::class create Aclass