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

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

View as plain text