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

     1  # Matches no subtests, parallel
     2  go test -run Test/Sub/ThisWillNotMatch standalone_parallel_sub_test.go
     3  stdout '^ok.*\[no tests to run\]'
     4  
     5  -- standalone_parallel_sub_test.go --
     6  package standalone_parallel_sub_test
     7  
     8  import "testing"
     9  
    10  func 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  }
    20  

View as plain text