diff options
author | Russ Cox <rsc@golang.org> | 2010-08-03 01:07:57 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-08-03 01:07:57 -0700 |
commit | 3f19d8ae8d9c1fd8bfbfadb3dda091a6147b8855 (patch) | |
tree | 80e5601735f4d33768ff98453b5beb907c4e0b20 /test/chan | |
parent | 585eae3bcea334eeda9c72fb90fca4c0828cc7d3 (diff) | |
download | go-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.go | 57 |
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() { |