(t *testing.T, method, path, badPath, body, badBody string)
| 1034 | } |
| 1035 | |
| 1036 | func testFormBindingForTimeFailLocation(t *testing.T, method, path, badPath, body, badBody string) { |
| 1037 | b := Form |
| 1038 | assert.Equal(t, "form", b.Name()) |
| 1039 | |
| 1040 | obj := FooStructForTimeTypeFailLocation{} |
| 1041 | req := requestWithBody(method, path, body) |
| 1042 | if method == http.MethodPost { |
| 1043 | req.Header.Add("Content-Type", MIMEPOSTForm) |
| 1044 | } |
| 1045 | err := b.Bind(req, &obj) |
| 1046 | require.Error(t, err) |
| 1047 | |
| 1048 | obj = FooStructForTimeTypeFailLocation{} |
| 1049 | req = requestWithBody(method, badPath, badBody) |
| 1050 | err = JSON.Bind(req, &obj) |
| 1051 | require.Error(t, err) |
| 1052 | } |
| 1053 | |
| 1054 | func testFormBindingIgnoreField(t *testing.T, method, path, badPath, body, badBody string) { |
| 1055 | b := Form |
no test coverage detected