diff --git a/binding/multipart_form_mapping_test.go b/binding/multipart_form_mapping_test.go index 60b5cbfe..1888862f 100644 --- a/binding/multipart_form_mapping_test.go +++ b/binding/multipart_form_mapping_test.go @@ -14,7 +14,25 @@ import ( "github.com/stretchr/testify/assert" ) -func TestFormMultipartBindingOneFileToBytesArrayFail(t *testing.T) { +func TestFormMultipartBindingOneFileToBytesFail1(t *testing.T) { + var test struct { + Voice []byte `form:"voice"` + } + + file := testFile{"voice", "test.pcm", []byte("pcm pcm pcm")} + req := createRequestMultipartFiles(t, file) + + err := req.ParseMultipartForm(3) + assert.NoError(t, err) + + err = req.MultipartForm.RemoveAll() + assert.NoError(t, err) + + err = mappingByPtr(&test, (*multipartRequest)(req), "form") + assert.Error(t, err) +} + +func TestFormMultipartBindingOneFileToBytesArray(t *testing.T) { var test struct { Voice []byte `form:"voice"` }