summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2019-11-14 17:04:39 (GMT)
committersebres <sebres@users.sourceforge.net>2019-11-14 17:04:39 (GMT)
commitf00d9f9d02d293675899b1c0ce23aa5cb641cd92 (patch)
tree117df81b0267c6a8aafb2cb23784c6404dd484d8 /tests/oo.test
parent37076881576fb0897e3c1c257ca37cd87685da0c (diff)
downloadtcl-f00d9f9d02d293675899b1c0ce23aa5cb641cd92.zip
tcl-f00d9f9d02d293675899b1c0ce23aa5cb641cd92.tar.gz
tcl-f00d9f9d02d293675899b1c0ce23aa5cb641cd92.tar.bz2
bug [135804138e]: test case illustrating the segfault
Diffstat (limited to 'tests/oo.test')
-rw-r--r--tests/oo.test29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test
index b0704da..55018e9 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -1353,6 +1353,35 @@ test oo-7.9 {OO: defining inheritance in namespaces} -setup {
return
}
} -result {}
+test oo-7.10 {OO: next after object deletion, bug [135804138e]} -setup {
+ set ::result ""
+ oo::class create c1 {
+ method m1 {} {
+ lappend ::result c1::m1
+ }
+ }
+ oo::class create c2 {
+ superclass c1
+ destructor {
+ lappend ::result c2::destructor
+ my m1
+ lappend ::result /c2::destructor
+ }
+ method m1 {} {
+ lappend ::result delete
+ rename [self] {}
+ lappend ::result no-self
+ next
+ lappend ::result unreachable
+ }
+ }
+} -body {
+ c2 create o
+ lappend ::result [catch {o m1} msg] $msg
+} -cleanup {
+ c1 destroy
+ unset ::result
+} -result {delete c2::destructor delete no-self c1::m1 unreachable /c2::destructor no-self 1 {no next method implementation}}
test oo-8.1 {OO: global must work in methods} {
oo::object create foo