| Server IP : 217.160.0.212 / Your IP : 216.73.217.80 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1073854427 ( 1073854427) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/go/src/cmd/go/testdata/script/ |
Upload File : |
go test -json
stdout '"Action":"output","Package":"p","Output":"M1"}'
stdout '"Action":"output","Package":"p","Test":"Test","Output":"=== RUN Test\\n"}'
stdout '"Action":"output","Package":"p","Test":"Test","Output":"T1"}'
stdout '"Action":"output","Package":"p","Test":"Test/Sub1","Output":"=== RUN Test/Sub1\\n"}'
stdout '"Action":"output","Package":"p","Test":"Test/Sub1","Output":"Sub1 x_test.go:19: SubLog1\\n"}'
stdout '"Action":"output","Package":"p","Test":"Test/Sub1","Output":"Sub2"}'
stdout '"Action":"output","Package":"p","Test":"Test/Sub1","Output":"--- PASS: Test/Sub1 \([\d.]+s\)\\n"}'
stdout '"Action":"pass","Package":"p","Test":"Test/Sub1","Elapsed"'
stdout '"Action":"output","Package":"p","Test":"Test/Sub3","Output":"foo bar"}'
stdout '"Action":"output","Package":"p","Test":"Test/Sub3","Output":"baz\\n"}'
stdout '"Action":"output","Package":"p","Test":"Test","Output":"T2"}'
stdout '"Action":"output","Package":"p","Test":"Test","Output":"--- PASS: Test \([\d.]+s\)\\n"}'
stdout '"Action":"pass","Package":"p","Test":"Test","Elapsed"'
stdout '"Action":"output","Package":"p","Output":"M2ok \\tp\\t[\d.]+s\\n"}'
stdout '"Action":"pass","Package":"p","Elapsed"'
-- go.mod --
module p
-- x_test.go --
package p
import (
"os"
"testing"
)
func TestMain(m *testing.M) {
print("M1")
code := m.Run()
print("M2")
os.Exit(code)
}
func Test(t *testing.T) {
print("T1")
t.Run("Sub1", func(t *testing.T) {
print("Sub1")
t.Log("SubLog1")
print("Sub2")
})
t.Run("Sub3", func(t *testing.T) {
print("\x16foo bar\x16baz\n")
})
print("T2")
}