aboutsummaryrefslogtreecommitdiff
path: root/test/chan
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-08-03 01:07:57 -0700
committerRuss Cox <rsc@golang.org>2010-08-03 01:07:57 -0700
commit3f19d8ae8d9c1fd8bfbfadb3dda091a6147b8855 (patch)
tree80e5601735f4d33768ff98453b5beb907c4e0b20 /test/chan
parent585eae3bcea334eeda9c72fb90fca4c0828cc7d3 (diff)
downloadgo-3f19d8ae8d9c1fd8bfbfadb3dda091a6147b8855.tar.gz
go-3f19d8ae8d9c1fd8bfbfadb3dda091a6147b8855.zip
gc: empty select
R=ken2 CC=golang-dev https://golang.org/cl/1871057
Diffstat (limited to 'test/chan')
-rw-r--r--test/chan/select3.go57
1 files changed, 26 insertions, 31 deletions
diff --git a/test/chan/select3.go b/test/chan/select3.go
index d4f7ebcec0..a1a2ef50b5 100644
--- a/test/chan/select3.go
+++ b/test/chan/select3.go
@@ -112,38 +112,33 @@ func main() {
<-ch
})
- // TODO(gri) remove this if once 6g accepts empty selects
- enabled := false
- if enabled {
- // empty selects always block
- testBlock(always, func() {
- select {
- case <-make(chan int): // remove this once 6g accepts empty selects
- }
- })
+ // empty selects always block
+ testBlock(always, func() {
+ select {
+ }
+ })
- // selects with only nil channels always block
- testBlock(always, func() {
- select {
- case <-nilch:
- unreachable()
- }
- })
- testBlock(always, func() {
- select {
- case nilch <- 7:
- unreachable()
- }
- })
- testBlock(always, func() {
- select {
- case <-nilch:
- unreachable()
- case nilch <- 7:
- unreachable()
- }
- })
- }
+ // selects with only nil channels always block
+ testBlock(always, func() {
+ select {
+ case <-nilch:
+ unreachable()
+ }
+ })
+ testBlock(always, func() {
+ select {
+ case nilch <- 7:
+ unreachable()
+ }
+ })
+ testBlock(always, func() {
+ select {
+ case <-nilch:
+ unreachable()
+ case nilch <- 7:
+ unreachable()
+ }
+ })
// selects with non-ready non-nil channels always block
testBlock(always, func() {