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

     1  [short] skip
     2  [!race] skip
     3  
     4  ! go test -v -race main_panic/testmain_parallel_sub_panic_test.go
     5  ! stdout 'DATA RACE'
     6  -- main_panic/testmain_parallel_sub_panic_test.go --
     7  package testmain_parallel_sub_panic_test
     8  
     9  import "testing"
    10  
    11  func setup()    { println("setup()") }
    12  func teardown() { println("teardown()") }
    13  func TestA(t *testing.T) {
    14  	t.Run("1", func(t *testing.T) {
    15  		t.Run("1", func(t *testing.T) {
    16  			t.Parallel()
    17  			panic("A/1/1 panics")
    18  		})
    19  		t.Run("2", func(t *testing.T) {
    20  			t.Parallel()
    21  			println("A/1/2 is ok")
    22  		})
    23  	})
    24  }
    25  
    26  func TestMain(m *testing.M) {
    27  	setup()
    28  	defer teardown()
    29  	m.Run()
    30  }

View as plain text