diff options
Diffstat (limited to 'src/pkg/net/http/header_test.go')
-rw-r--r-- | src/pkg/net/http/header_test.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pkg/net/http/header_test.go b/src/pkg/net/http/header_test.go index 2313b5549..a2b82a701 100644 --- a/src/pkg/net/http/header_test.go +++ b/src/pkg/net/http/header_test.go @@ -6,6 +6,7 @@ package http import ( "bytes" + "runtime" "testing" "time" ) @@ -178,7 +179,7 @@ var testHeader = Header{ "Content-Length": {"123"}, "Content-Type": {"text/plain"}, "Date": {"some date at some time Z"}, - "Server": {"Go http package"}, + "Server": {DefaultUserAgent}, } var buf bytes.Buffer @@ -192,13 +193,14 @@ func BenchmarkHeaderWriteSubset(b *testing.B) { } func TestHeaderWriteSubsetMallocs(t *testing.T) { + if runtime.GOMAXPROCS(0) > 1 { + t.Skip("skipping; GOMAXPROCS>1") + } n := testing.AllocsPerRun(100, func() { buf.Reset() testHeader.WriteSubset(&buf, nil) }) - if n > 1 { - // TODO(bradfitz,rsc): once we can sort without allocating, - // make this an error. See http://golang.org/issue/3761 - // t.Errorf("got %v allocs, want <= %v", n, 1) + if n > 0 { + t.Errorf("mallocs = %d; want 0", n) } } |