]> Cypherpunks repositories - gostls13.git/commitdiff
test/chan: document tests
authorRob Pike <r@golang.org>
Sun, 19 Feb 2012 06:44:02 +0000 (17:44 +1100)
committerRob Pike <r@golang.org>
Sun, 19 Feb 2012 06:44:02 +0000 (17:44 +1100)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5677094

16 files changed:
test/chan/doubleselect.go
test/chan/fifo.go
test/chan/goroutines.go
test/chan/nonblock.go
test/chan/perm.go
test/chan/powser1.go
test/chan/powser2.go
test/chan/select.go
test/chan/select2.go
test/chan/select3.go
test/chan/select4.go
test/chan/select5.go
test/chan/select6.go
test/chan/sieve1.go
test/chan/sieve2.go
test/chan/zerosize.go

index 15df249444aefb9757be32689bc359cfb4b0cfc4..ac559302d9bfef215aa33b430ada0adc1c010b2c 100644 (file)
@@ -4,8 +4,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// This test is designed to flush out the case where two cases of a select can
+// Test the situation in which two cases of a select can
 // both end up running. See http://codereview.appspot.com/180068.
+
 package main
 
 import (
index a8dcaef8aefbb9ea0437d2cafab20c0bbee5d2d9..70d20b31f098ee0f5f629c10fbd7ac93b9e2afad 100644 (file)
@@ -4,7 +4,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Verify that unbuffered channels act as pure fifos.
+// Test that unbuffered channels act as pure fifos.
 
 package main
 
index f52ff582af3c1f1124ee8d036b8bb5f1a2e0500e..6ffae7df65f45406b423113de7d5817fc00b808a 100644 (file)
@@ -4,8 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// make a lot of goroutines, threaded together.
-// tear them down cleanly.
+// Torture test for goroutines.
+// Make a lot of goroutines, threaded together, and tear them down cleanly.
 
 package main
 
index eff1a4898cc36a4a49c3a50d8d7c9cb639c75bc6..7e3c0c74daec7568d6d1b6ee4f3ca2d785e5fcb7 100644 (file)
@@ -4,8 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Verify channel operations that test for blocking
-// Use several sizes and types of operands
+// Test channel operations that test for blocking.
+// Use several sizes and types of operands.
 
 package main
 
index 89e32f1eba66b81fdf8c55911669e2d6f95418c5..7e152c5eb5a2f51d896d4c94706780947dd92861 100644 (file)
@@ -4,6 +4,10 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test various correct and incorrect permutations of send-only,
+// receive-only, and bidirectional channels.
+// Does not compile.
+
 package main
 
 var (
index 4d4882b48944498ef1bcb3a57425eb1ce6c52dfe..6bf2a911157d1a73ee2116994fd2571ec01c0dff 100644 (file)
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: power series.
+
 // Power series package
 // A power series is a channel, along which flow rational
 // coefficients.  A denominator of zero signifies the end.
index 6efb358f3c8388c52a21eb4058ca6f031ad3abd5..33abd5c53fe7b2378274d4939d0aea2951241e28 100644 (file)
@@ -4,15 +4,18 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: power series.
+
+// Like powser1.go but uses channels of interfaces.
+// Has not been cleaned up as much as powser1.go, to keep
+// it distinct and therefore a different test.
+
 // Power series package
 // A power series is a channel, along which flow rational
 // coefficients.  A denominator of zero signifies the end.
 // Original code in Newsqueak by Doug McIlroy.
 // See Squinting at Power Series by Doug McIlroy,
 //   http://www.cs.bell-labs.com/who/rsc/thread/squint.pdf
-// Like powser1.go but uses channels of interfaces.
-// Has not been cleaned up as much as powser1.go, to keep
-// it distinct and therefore a different test.
 
 package main
 
index ce26177d549f7d92c660e95a3259cfe42b9c01a9..38fa7e1e3f8708c0871402def9778e43f93928b5 100644 (file)
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple select.
+
 package main
 
 var counter uint
index 37a2d36a9404f7b0c1c589a81677865dae553347..40bc357b5d715e652be55692bc1d70f2d0939bd1 100644 (file)
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that selects do not consume undue memory.
+
 package main
 
 import "runtime"
index 4acb93ab79ae52f5f916db14eeb38c1632b20136..847d8ed37ed25a4c06db3188f063b5fb808867e7 100644 (file)
@@ -4,7 +4,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Tests verifying the semantics of the select statement
+// Test the semantics of the select statement
 // for basic empty/non-empty cases.
 
 package main
index 1830150fd354cc7c3720eb2c52c7ee9858e62481..500364038566baba9a65f953a01dabde30171212 100644 (file)
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file
 
+// Test that a select statement proceeds when a value is ready.
+
 package main
 
 func f() *int {
index cc2cc71000ef1171e8d6faba947d1714258006e1..13cde1afe58e8ee0b7d6720e5056b1422006b83e 100644 (file)
@@ -7,7 +7,10 @@
 // license that can be found in the LICENSE file.
 
 // Generate test of channel operations and simple selects.
-// Only doing one real send or receive at a time, but phrased
+// The output of this program is compiled and run to do the
+// actual test.
+
+// Each test does only one real send or receive at a time, but phrased
 // in various ways that the compiler may or may not rewrite
 // into simpler expressions.
 
index 06f934e501a1d41ce6aca3104b76dac00da2a633..af470a0d0d187fcc5ac237118c7b8a98ab6b8ce6 100644 (file)
@@ -4,7 +4,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Issue 2075
+// Test for select: Issue 2075
 // A bug in select corrupts channel queues of failed cases
 // if there are multiple waiters on those channels and the
 // select is the last in the queue. If further waits are made
index 4698dba6d66928169c2a064eb7ccef657957e8b2..acc310f6c79ae6ce958b656663d7184aeff0dbe5 100644 (file)
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: classical inefficient concurrent prime sieve.
+
 // Generate primes up to 100 using channels, checking the results.
 // This sieve consists of a linear chain of divisibility filters,
 // equivalent to trial-dividing each n by all primes p ≤ n.
index 95bf10a61f74f1d2aa9f1c6b7e66370079cf694e..09e5c527b6cca9c3c59f05676c1732d3fb5a0132 100644 (file)
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: prime sieve of Eratosthenes.
+
 // Generate primes up to 100 using channels, checking the results.
 // This sieve is Eratosthenesque and only considers odd candidates.
 // See discussion at <http://blog.onideas.ws/eratosthenes.go>.
index b3fe84260c23065eb8564e5533d6df060018251f..50aca857cbed5f049c6ea6176d691da8caaae7ce 100644 (file)
@@ -4,7 +4,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Making channels of a zero-sized type should not panic.
+// Test making channels of a zero-sized type.
 
 package main