summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/oo.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test
index 502b3f7..38a7cad 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -1765,6 +1765,31 @@ test oo-11.7 {Bug 154f0982f2: createWithNamespace and an existing namespace} -se
Aclass destroy
catch {namespace delete test_oo117}
} -result {can't create namespace "::test_oo117": already exists}
+test oo-11.8 {Bug 708422: unset traces in deletion shouldn't crash} -setup {
+ oo::class create foo {
+ self export createWithNamespace
+ method dummy {} {}
+ }
+ set result {}
+} -body {
+ oo::define foo {
+ variable x
+ constructor {} {
+ trace add variable x unset [list apply {{self ns args} {
+ global result
+ lappend result [info object isa object $self]
+ lappend result [namespace exists $ns]
+ # Method dispatch fails; too much gone in this case
+ catch {$self dummy} msg
+ lappend result $msg
+ }} [self] [self namespace]]
+ }
+ }
+ [foo createWithNamespace bar oo-11.8] destroy
+ return $result
+} -cleanup {
+ foo destroy
+} -result {1 0 {impossible to invoke method "dummy": no defined method or unknown method}}
test oo-12.1 {OO: filters} {
oo::class create Aclass