summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2024-05-16 15:38:08 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2024-05-16 15:38:08 (GMT)
commitc03fe1c10791d187d6a7cf3a3691de72fcd208d9 (patch)
tree17077f72f6146bc98645eb1d48950ae70264ba80 /tests/oo.test
parentcd7cab57d4a3f8c449a4a6c1db9a3882ce610b9d (diff)
downloadtcl-c03fe1c10791d187d6a7cf3a3691de72fcd208d9.zip
tcl-c03fe1c10791d187d6a7cf3a3691de72fcd208d9.tar.gz
tcl-c03fe1c10791d187d6a7cf3a3691de72fcd208d9.tar.bz2
Test that hits [87271f7cd6] reasonably precisely
Diffstat (limited to 'tests/oo.test')
-rw-r--r--tests/oo.test40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test
index abd5d31..fa2adf8 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -3296,6 +3296,46 @@ test oo-22.2 {OO and info frame: Bug 3001438} -setup {
} -match glob -cleanup {
c destroy
} -result {* cmd {info frame 0} method test class ::c level 0}
+test oo-22.3 {OO and coroutines and info frame} -setup {
+ oo::class create A {
+ self method run {nworkers} {
+ set ::result {}
+ set workers {}
+ for {set n 1} {$n <= $nworkers} {incr n} {
+ set worker [A create a$n]
+ lappend workers $worker
+ $worker schedule
+ }
+ after 250 [namespace code {variable forever false}]
+ variable forever true
+ vwait [my varname forever]
+ foreach worker $workers {
+ $worker destroy
+ }
+ return $::result
+ }
+ method schedule {} {
+ set coro coro-[namespace tail [self]]
+ if {[llength [info commands $coro]] == 0} {
+ coroutine $coro my Work
+ }
+ }
+ method Work {} {
+ after 0 [info coroutine]
+ yield
+ lappend ::result [dump]
+ }
+ }
+} -body {
+ # Triggers a crash with incorrectly restored procPtr->cmdPtr
+ proc dump {} {
+ info frame [expr {[info frame] - 1}]
+ }
+ A run 2
+} -cleanup {
+ catch {rename dump {}}
+ catch {A destroy}
+} -match glob -result {{* method Work object *} {* method Work object *}}
# Prove that the issue in [Bug 1865054] isn't an issue any more
test oo-23.1 {Self-like derivation; complex case!} -setup {