]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.power64] reflect: fix test not to hang even if TrySend lies
authorRuss Cox <rsc@golang.org>
Thu, 14 Aug 2014 18:35:00 +0000 (14:35 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 14 Aug 2014 18:35:00 +0000 (14:35 -0400)
LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/124360043

src/pkg/reflect/all_test.go

index f122711731748c20f39fd935d9489d7da479caa2..50d223f9231437b6d61115beebbdc4b9023e3ddf 100644 (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)