(t *testing.T)
| 70 | } |
| 71 | |
| 72 | func TestFormMultipartBindingBindError(t *testing.T) { |
| 73 | files := []testFile{ |
| 74 | {"file", "file1", []byte("hello")}, |
| 75 | {"file", "file2", []byte("world")}, |
| 76 | } |
| 77 | |
| 78 | for _, tt := range []struct { |
| 79 | name string |
| 80 | s any |
| 81 | }{ |
| 82 | {"wrong type", &struct { |
| 83 | Files int `form:"file"` |
| 84 | }{}}, |
| 85 | {"wrong array size", &struct { |
| 86 | Files [1]*multipart.FileHeader `form:"file"` |
| 87 | }{}}, |
| 88 | {"wrong slice type", &struct { |
| 89 | Files []int `form:"file"` |
| 90 | }{}}, |
| 91 | } { |
| 92 | req := createRequestMultipartFiles(t, files...) |
| 93 | err := FormMultipart.Bind(req, tt.s) |
| 94 | require.Error(t, err) |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | type testFile struct { |
| 99 | Fieldname string |
nothing calls this directly
no test coverage detected