diff options
Diffstat (limited to 'src/testing/sub_test.go')
| -rw-r--r-- | src/testing/sub_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testing/sub_test.go b/src/testing/sub_test.go index 8d5d9206f0..bb7b3e0925 100644 --- a/src/testing/sub_test.go +++ b/src/testing/sub_test.go @@ -6,6 +6,7 @@ package testing import ( "bytes" + "fmt" "regexp" "strings" "sync/atomic" @@ -515,3 +516,19 @@ func TestBenchmarkOutput(t *T) { Benchmark(func(b *B) { b.Error("do not print this output") }) Benchmark(func(b *B) {}) } + +func TestParallelSub(t *T) { + c := make(chan int) + block := make(chan int) + for i := 0; i < 10; i++ { + go func(i int) { + <-block + t.Run(fmt.Sprint(i), func(t *T) {}) + c <- 1 + }(i) + } + close(block) + for i := 0; i < 10; i++ { + <-c + } +} |
