...

Text file src/cmd/go/testdata/script/test_match_no_subtests_parallel.txt

Documentation: cmd/go/testdata/script

     1# Matches no subtests, parallel
     2go test -run Test/Sub/ThisWillNotMatch standalone_parallel_sub_test.go
     3stdout '^ok.*\[no tests to run\]'
     4
     5-- standalone_parallel_sub_test.go --
     6package standalone_parallel_sub_test
     7
     8import "testing"
     9
    10func Test(t *testing.T) {
    11	ch := make(chan bool, 1)
    12	t.Run("Sub", func(t *testing.T) {
    13		t.Parallel()
    14		<-ch
    15		t.Run("Nested", func(t *testing.T) {})
    16	})
    17	// Ensures that Sub will finish after its t.Run call already returned.
    18	ch <- true
    19}

View as plain text