mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 21:32:11 +08:00
test(binding): add test for MapFromWithTag
This commit is contained in:
parent
df4fe38553
commit
6e61cf871e
@ -145,6 +145,15 @@ func TestMappingForm(t *testing.T) {
|
||||
assert.Equal(t, int(6), s.F)
|
||||
}
|
||||
|
||||
func TestMapFormWithTag(t *testing.T) {
|
||||
var s struct {
|
||||
F int `externalTag:"field"`
|
||||
}
|
||||
err := MapFormWithTag(&s, map[string][]string{"field": {"6"}}, "externalTag")
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, int(6), s.F)
|
||||
}
|
||||
|
||||
func TestMappingTime(t *testing.T) {
|
||||
var s struct {
|
||||
Time time.Time
|
||||
|
Loading…
x
Reference in New Issue
Block a user