add test function

This commit is contained in:
guonaihong 2019-08-14 21:31:59 +08:00
parent 895518e3b0
commit 93567f91e6

View File

@ -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