crossbeam
crossbeam copied to clipboard
Add more golang channel tests (closedchan)
This addresses #201 , specifically tests from here https://github.com/golang/go/blob/master/test/closedchan.go
I am yet new to Rust. Currently there are 3 issues:
-
send
implementation ofChan
can panic while holding theMutex
. This is bad if we want to test for panic to occur. Do you have any suggestions on where should I look? My implementation in comments works in my case, but some other tests are started to take more than 60 seconds. -
send
inselect!
for closed channels blocks, because it returns sender forbounded(0)
. InGo
panic is expected. I can implementSenderFlavour
which always panics, but it will impose runtime overhead for other code, so it doesn't worth it. Can it be done other way? - problem with packing closures in generic vector (I will deal with it later)
Please let me know your opinion.