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

     1  # Regression test for https://golang.org/issue/40657: output from the main test
     2  # function should be attributed correctly even if interleaved with the PAUSE
     3  # line for a new parallel subtest.
     4  
     5  [short] skip
     6  
     7  go test -json
     8  stdout '"Test":"TestWeirdTiming","Output":"[^"]* logging to outer again\\n"'
     9  
    10  -- go.mod --
    11  module example.com
    12  go 1.15
    13  -- main_test.go --
    14  package main
    15  
    16  import (
    17  	"testing"
    18  )
    19  
    20  func TestWeirdTiming(outer *testing.T) {
    21  	outer.Run("pauser", func(pauser *testing.T) {
    22  		outer.Logf("logging to outer")
    23  		pauser.Parallel()
    24  	})
    25  
    26  	outer.Logf("logging to outer again")
    27  }
    28  

View as plain text