1
0
mirror of https://github.com/golang/go synced 2024-11-21 16:44:43 -07:00

http: avoid name error in test

R=adg
CC=golang-dev
https://golang.org/cl/5316070
This commit is contained in:
Russ Cox 2011-11-01 21:45:37 -04:00
parent 758200f219
commit b4e35629ed

View File

@ -49,7 +49,7 @@ func TestPostQuery(t *testing.T) {
type stringMap map[string][]string
type parseContentTypeTest struct {
contentType stringMap
error bool
err bool
}
var parseContentTypeTests = []parseContentTypeTest{
@ -58,7 +58,7 @@ var parseContentTypeTests = []parseContentTypeTest{
{contentType: stringMap{"Content-Type": {"text/plain; boundary="}}},
{
contentType: stringMap{"Content-Type": {"application/unknown"}},
error: true,
err: true,
},
}
@ -70,10 +70,10 @@ func TestPostContentTypeParsing(t *testing.T) {
Body: ioutil.NopCloser(bytes.NewBufferString("body")),
}
err := req.ParseForm()
if !test.error && err != nil {
if !test.err && err != nil {
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)
}
}