type stringMap map[string][]string
type parseContentTypeTest struct {
contentType stringMap
- error bool
+ err bool
}
var parseContentTypeTests = []parseContentTypeTest{
{contentType: stringMap{"Content-Type": {"text/plain; boundary="}}},
{
contentType: stringMap{"Content-Type": {"application/unknown"}},
- error: true,
+ err: true,
},
}
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)
}
}