Tcl Source Code

Check-in [30b5977b56]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Revise coroutines tests so they do not leave behind frame footprints that can interfere with other tests.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | core-8-6-branch
Files: files | file ages | folders
SHA3-256: 30b5977b5664dc4e21617287cb9dff7e25134445000f4bee22549c9f8970ac3c
User & Date: dgp 2019-04-17 14:34:42.401
Context
2019-04-17
20:00
merge 8.5 check-in: eaafb5917f user: sebres tags: core-8-6-branch
15:08
[60559fd4a6] Test more robust against frame contexts of testing environment. check-in: 1b2cf8fff3 user: dgp tags: core-8-branch
14:34
Revise coroutines tests so they do not leave behind frame footprints that can interfere with other t... check-in: 30b5977b56 user: dgp tags: core-8-6-branch
14:28
Isolate tests of [info frame] results from testing environment. check-in: 572f113bbb user: dgp tags: core-8-6-branch
2019-04-11
21:39
Suggested fix for [60559fd4a6]: put selected tests in child interps Closed-Leaf check-in: d321b807d3 user: dkf tags: bug-60559fd4a6
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to tests/coroutine.test.
622
623
624
625
626
627
628
629
630
631
632
633
634














635

636

637


638


639
640
641


642
643
644
645
646
647
648
622
623
624
625
626
627
628






629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644

645
646
647
648

649
650
651


652
653
654
655
656
657
658
659
660







-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
-
+

+
+
-
+
+

-
-
+
+







test coroutine-7.5 {return codes} {
    set result {}
    foreach code {0 1 2 3 4 5} {
	lappend result [catch {coroutine demo return -level 0 -code $code}]
    }
    set result
} {0 1 2 3 4 5}
test coroutine-7.6 {Early yield crashes} {
    proc foo args {}
    trace add execution foo enter {catch yield}
    coroutine demo foo
    rename foo {}
} {}
test coroutine-7.6 {Early yield crashes} -setup {
    set i [interp create]
} -body {
    # Force into a child interpreter [bug 60559fd4a6]
    $i eval {
	proc foo args {}
	trace add execution foo enter {catch yield}
	coroutine demo foo
	rename foo {}
	return ok
    }
} -cleanup {
    interp delete $i
} -result ok
test coroutine-7.7 {Bug 2486550} -setup {
    set i [interp create]
    interp hide {} yield
    $i hide yield
} -body {
    # Force into a child interpreter [bug 60559fd4a6]
    $i eval {
    coroutine demo interp invokehidden {} yield ok
	coroutine demo interp invokehidden {} yield ok
    }
} -cleanup {
    demo
    interp expose {} yield
    $i eval demo
    interp delete $i
} -result ok
test coroutine-7.8 {yieldto context nuke: Bug a90d9331bc} -setup {
    namespace eval cotest {}
    set ::result ""
} -body {
    proc cotest::body {} {
	lappend ::result a
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
788
789
790
791
792
793
794


795
796
797
798
799
800
801
802
803
804







-
-










    }
    slave eval demo
    set result [slave eval {set ::result}]

    interp delete slave
    set result
} -result {inject-executed}



# cleanup
unset lambda
::tcltest::cleanupTests

return

# Local Variables:
# mode: tcl
# End: