aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/http/cgi/integration_test.go12
-rw-r--r--src/net/http/fs_test.go2
-rw-r--r--src/net/http/httptest/server.go2
-rw-r--r--src/net/http/serve_test.go6
4 files changed, 11 insertions, 11 deletions
diff --git a/src/net/http/cgi/integration_test.go b/src/net/http/cgi/integration_test.go
index ef2eaf748b..4890ae0707 100644
--- a/src/net/http/cgi/integration_test.go
+++ b/src/net/http/cgi/integration_test.go
@@ -31,7 +31,7 @@ func TestHostingOurselves(t *testing.T) {
h := &Handler{
Path: os.Args[0],
Root: "/test.go",
- Args: []string{"-test.run=TestBeChildCGIProcess"},
+ Args: []string{"-test.run=^TestBeChildCGIProcess$"},
}
expectedMap := map[string]string{
"test": "Hello CGI-in-CGI",
@@ -98,7 +98,7 @@ func TestKillChildAfterCopyError(t *testing.T) {
h := &Handler{
Path: os.Args[0],
Root: "/test.go",
- Args: []string{"-test.run=TestBeChildCGIProcess"},
+ Args: []string{"-test.run=^TestBeChildCGIProcess$"},
}
req, _ := http.NewRequest("GET", "http://example.com/test.cgi?write-forever=1", nil)
rec := httptest.NewRecorder()
@@ -120,7 +120,7 @@ func TestChildOnlyHeaders(t *testing.T) {
h := &Handler{
Path: os.Args[0],
Root: "/test.go",
- Args: []string{"-test.run=TestBeChildCGIProcess"},
+ Args: []string{"-test.run=^TestBeChildCGIProcess$"},
}
expectedMap := map[string]string{
"_body": "",
@@ -139,7 +139,7 @@ func TestNilRequestBody(t *testing.T) {
h := &Handler{
Path: os.Args[0],
Root: "/test.go",
- Args: []string{"-test.run=TestBeChildCGIProcess"},
+ Args: []string{"-test.run=^TestBeChildCGIProcess$"},
}
expectedMap := map[string]string{
"nil-request-body": "false",
@@ -154,7 +154,7 @@ func TestChildContentType(t *testing.T) {
h := &Handler{
Path: os.Args[0],
Root: "/test.go",
- Args: []string{"-test.run=TestBeChildCGIProcess"},
+ Args: []string{"-test.run=^TestBeChildCGIProcess$"},
}
var tests = []struct {
name string
@@ -202,7 +202,7 @@ func want500Test(t *testing.T, path string) {
h := &Handler{
Path: os.Args[0],
Root: "/test.go",
- Args: []string{"-test.run=TestBeChildCGIProcess"},
+ Args: []string{"-test.run=^TestBeChildCGIProcess$"},
}
expectedMap := map[string]string{
"_body": "",
diff --git a/src/net/http/fs_test.go b/src/net/http/fs_test.go
index 2e15773652..cfabaae353 100644
--- a/src/net/http/fs_test.go
+++ b/src/net/http/fs_test.go
@@ -1280,7 +1280,7 @@ func TestLinuxSendfile(t *testing.T) {
defer os.Remove(filepath)
var buf strings.Builder
- child := testenv.Command(t, "strace", "-f", "-q", os.Args[0], "-test.run=TestLinuxSendfileChild")
+ child := testenv.Command(t, "strace", "-f", "-q", os.Args[0], "-test.run=^TestLinuxSendfileChild$")
child.ExtraFiles = append(child.ExtraFiles, lnf)
child.Env = append([]string{"GO_WANT_HELPER_PROCESS=1"}, os.Environ()...)
child.Stdout = &buf
diff --git a/src/net/http/httptest/server.go b/src/net/http/httptest/server.go
index f254a494d1..79749a0378 100644
--- a/src/net/http/httptest/server.go
+++ b/src/net/http/httptest/server.go
@@ -77,7 +77,7 @@ func newLocalListener() net.Listener {
// When debugging a particular http server-based test,
// this flag lets you run
//
-// go test -run=BrokenTest -httptest.serve=127.0.0.1:8000
+// go test -run='^BrokenTest$' -httptest.serve=127.0.0.1:8000
//
// to start the broken server so you can interact with it manually.
// We only register this flag if it looks like the caller knows about it
diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go
index e71c5365e1..2473a88056 100644
--- a/src/net/http/serve_test.go
+++ b/src/net/http/serve_test.go
@@ -4992,7 +4992,7 @@ func benchmarkClientServerParallel(b *testing.B, parallelism int, mode testMode)
// For use like:
//
// $ go test -c
-// $ ./http.test -test.run=XX -test.bench=BenchmarkServer -test.benchtime=15s -test.cpuprofile=http.prof
+// $ ./http.test -test.run=XX -test.bench='^BenchmarkServer$' -test.benchtime=15s -test.cpuprofile=http.prof
// $ go tool pprof http.test http.prof
// (pprof) web
func BenchmarkServer(b *testing.B) {
@@ -5031,7 +5031,7 @@ func BenchmarkServer(b *testing.B) {
defer ts.Close()
b.StartTimer()
- cmd := testenv.Command(b, os.Args[0], "-test.run=XXXX", "-test.bench=BenchmarkServer$")
+ cmd := testenv.Command(b, os.Args[0], "-test.run=XXXX", "-test.bench=^BenchmarkServer$")
cmd.Env = append([]string{
fmt.Sprintf("TEST_BENCH_CLIENT_N=%d", b.N),
fmt.Sprintf("TEST_BENCH_SERVER_URL=%s", ts.URL),
@@ -5086,7 +5086,7 @@ func BenchmarkClient(b *testing.B) {
// Start server process.
ctx, cancel := context.WithCancel(context.Background())
- cmd := testenv.CommandContext(b, ctx, os.Args[0], "-test.run=XXXX", "-test.bench=BenchmarkClient$")
+ cmd := testenv.CommandContext(b, ctx, os.Args[0], "-test.run=XXXX", "-test.bench=^BenchmarkClient$")
cmd.Env = append(cmd.Environ(), "TEST_BENCH_SERVER=yes")
cmd.Stderr = os.Stderr
stdout, err := cmd.StdoutPipe()