mirror of
https://github.com/golang/go
synced 2024-10-05 18:31:28 -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:
parent
25d4d75376
commit
0bee7f3a17
@ -1052,6 +1052,11 @@ func TestChan(t *testing.T) {
|
|||||||
ok = cv.TrySend(ValueOf(6))
|
ok = cv.TrySend(ValueOf(6))
|
||||||
if !ok {
|
if !ok {
|
||||||
t.Errorf("TrySend on empty chan failed")
|
t.Errorf("TrySend on empty chan failed")
|
||||||
|
select {
|
||||||
|
case x := <-c:
|
||||||
|
t.Errorf("TrySend failed but it did send %d", x)
|
||||||
|
default:
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if i = <-c; i != 6 {
|
if i = <-c; i != 6 {
|
||||||
t.Errorf("TrySend 6, recv %d", i)
|
t.Errorf("TrySend 6, recv %d", i)
|
||||||
|
Loading…
Reference in New Issue
Block a user