Tcl Source Code

Check-in [d7428a1ea0]
Login

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

Overview
Comment:test for issue [5106fddd4400e5b9b], failure to yieldto is not the same thing as not calling yieldto in the first place
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-f9800d52bd61f240
Files: files | file ages | folders
SHA3-256: d7428a1ea0f47cbaaf6e6e7fe36c61a2e28cc8ea01cae0ee85a29adf0a5c8071
User & Date: pooryorick 2021-06-21 05:40:22
Context
2021-06-21
21:21
Improve logic and cleanup for tests coroutine-7.13 and coroutine-7.14 Closed-Leaf check-in: 5908ade8c3 user: pooryorick tags: bug-f9800d52bd61f240
05:47
merge bug-f9800d52bd61f240 check-in: 5cfdd6ee7b user: pooryorick tags: core-8-branch
05:40
test for issue [5106fddd4400e5b9b], failure to yieldto is not the same thing as not calling yieldto ... check-in: d7428a1ea0 user: pooryorick tags: bug-f9800d52bd61f240
2021-06-20
22:47
Fix for [f9800d52bd61f240], vwait is not NRE-enabled, and yieldto cannot find the right splicing spo... check-in: eb50e83ee1 user: pooryorick tags: bug-f9800d52bd61f240
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/coroutine.test.

753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
    list
} -cleanup {
    rename boom {}; rename cc {}; rename c {}
} -result {}


test coroutine-7.13 {
issue f9800d52bd61f240

vwait is not NRE-enabled, and yieldto cannot find the right splicing spot
} -body {
	coroutine c0 apply [list {} {
		variable done
		yield
		yieldto c1
		after 0 c2 
		vwait [namespace current]::done







|

|







753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
    list
} -cleanup {
    rename boom {}; rename cc {}; rename c {}
} -result {}


test coroutine-7.13 {
	issue f9800d52bd61f240

	vwait is not NRE-enabled, and yieldto cannot find the right splicing spot
} -body {
	coroutine c0 apply [list {} {
		variable done
		yield
		yieldto c1
		after 0 c2 
		vwait [namespace current]::done
784
785
786
787
788
789
790
































791
792
793
794
795
796
797
		set done 1
	} [namespace current]]

	after 0 [list [namespace which c0]]
	vwait [namespace current]::done
	return $done
} -result 1 

































test coroutine-8.0.0 {coro inject executed} -body {
    coroutine demo apply {{} { foreach i {1 2} yield }}
    demo
    set ::result none
    tcl::unsupported::inject demo set ::result inject-executed
    demo







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
		set done 1
	} [namespace current]]

	after 0 [list [namespace which c0]]
	vwait [namespace current]::done
	return $done
} -result 1 


test coroutine-7.14 {
	issue 5106fddd4400e5b9 

	failure to yieldto is not the same thing as not calling yieldto in the
	first place
} -body {
	variable done
	variable done1

	coroutine c0 ::apply [list {} {
		yield
		variable done0
		after 0 [list [namespace which c1]]
		vwait [namespace current]::done0
	} [namespace current]]

	coroutine c1 ::apply [list {} {
		variable done0
		yield
		yieldto try "yieldto [list [info coroutine]]" on error {} "
			::set [list [namespace current]]::done1 failure
			::set [list [namespace current]]::done0 failure
		"
		set done0 success
	} [namespace current]]
	after 1 [list [namespace which c0]]
	vwait [namespace current]::done0
	return [list $done0 $done1]
} -result {failure failure} 


test coroutine-8.0.0 {coro inject executed} -body {
    coroutine demo apply {{} { foreach i {1 2} yield }}
    demo
    set ::result none
    tcl::unsupported::inject demo set ::result inject-executed
    demo