mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-17 05:42:09 +08:00
add test function
This commit is contained in:
parent
895518e3b0
commit
93567f91e6
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user