1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:51:21 -06:00

[dev.power64] reflect: fix test not to hang even if TrySend lies

LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/124360043
This commit is contained in:
Russ Cox 2014-08-14 14:35:00 -04:00
parent 25d4d75376
commit 0bee7f3a17

View File

@ -1052,6 +1052,11 @@ func TestChan(t *testing.T) {
ok = cv.TrySend(ValueOf(6))
if !ok {
t.Errorf("TrySend on empty chan failed")
select {
case x := <-c:
t.Errorf("TrySend failed but it did send %d", x)
default:
}
} else {
if i = <-c; i != 6 {
t.Errorf("TrySend 6, recv %d", i)