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

     1  [short] skip
     2  
     3  # go test -parallel -1 shouldn't work
     4  ! go test -parallel -1 standalone_parallel_sub_test.go
     5  stdout '-parallel can only be given'
     6  
     7  # go test -parallel 0 shouldn't work
     8  ! go test -parallel 0 standalone_parallel_sub_test.go
     9  stdout '-parallel can only be given'
    10  
    11  -- standalone_parallel_sub_test.go --
    12  package standalone_parallel_sub_test
    13  
    14  import "testing"
    15  
    16  func Test(t *testing.T) {
    17  	ch := make(chan bool, 1)
    18  	t.Run("Sub", func(t *testing.T) {
    19  		t.Parallel()
    20  		<-ch
    21  		t.Run("Nested", func(t *testing.T) {})
    22  	})
    23  	// Ensures that Sub will finish after its t.Run call already returned.
    24  	ch <- true
    25  }
    26  

View as plain text