Commit b4e35629 authored by Russ Cox's avatar Russ Cox

http: avoid name error in test

R=adg
CC=golang-dev
https://golang.org/cl/5316070
parent 758200f2
...@@ -49,7 +49,7 @@ func TestPostQuery(t *testing.T) { ...@@ -49,7 +49,7 @@ func TestPostQuery(t *testing.T) {
type stringMap map[string][]string type stringMap map[string][]string
type parseContentTypeTest struct { type parseContentTypeTest struct {
contentType stringMap contentType stringMap
error bool err bool
} }
var parseContentTypeTests = []parseContentTypeTest{ var parseContentTypeTests = []parseContentTypeTest{
...@@ -58,7 +58,7 @@ var parseContentTypeTests = []parseContentTypeTest{ ...@@ -58,7 +58,7 @@ var parseContentTypeTests = []parseContentTypeTest{
{contentType: stringMap{"Content-Type": {"text/plain; boundary="}}}, {contentType: stringMap{"Content-Type": {"text/plain; boundary="}}},
{ {
contentType: stringMap{"Content-Type": {"application/unknown"}}, contentType: stringMap{"Content-Type": {"application/unknown"}},
error: true, err: true,
}, },
} }
...@@ -70,10 +70,10 @@ func TestPostContentTypeParsing(t *testing.T) { ...@@ -70,10 +70,10 @@ func TestPostContentTypeParsing(t *testing.T) {
Body: ioutil.NopCloser(bytes.NewBufferString("body")), Body: ioutil.NopCloser(bytes.NewBufferString("body")),
} }
err := req.ParseForm() err := req.ParseForm()
if !test.error && err != nil { if !test.err && err != nil {
t.Errorf("test %d: Unexpected error: %v", i, err) t.Errorf("test %d: Unexpected error: %v", i, err)
} }
if test.error && err == nil { if test.err && err == nil {
t.Errorf("test %d should have returned error", i) t.Errorf("test %d should have returned error", i)
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment