From 93567f91e679dc2c83773f1d539b4b3edd250ffb Mon Sep 17 00:00:00 2001 From: guonaihong Date: Wed, 14 Aug 2019 21:31:59 +0800 Subject: [PATCH] add test function --- binding/form_mapping_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/binding/form_mapping_test.go b/binding/form_mapping_test.go index c9d6111b..772ac144 100644 --- a/binding/form_mapping_test.go +++ b/binding/form_mapping_test.go @@ -260,6 +260,15 @@ func TestMappingStructField(t *testing.T) { assert.Equal(t, 9, s.J.I) } +func TestByteArray(t *testing.T) { + var s struct { + B []byte + } + err := mappingByPtr(&s, formSource{"B": {"hello"}}, "form") + assert.NoError(t, err) + assert.Equal(t, []byte("hello"), s.B) +} + func TestMappingMapField(t *testing.T) { var s struct { M map[string]int