Skip to content

Commit

Permalink
test(binding): add test for MapFromWithTag
Browse files Browse the repository at this point in the history
  • Loading branch information
mtt0 committed Jun 25, 2021
1 parent df4fe38 commit 6e61cf8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions binding/form_mapping_test.go
Expand Up @@ -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
Expand Down

0 comments on commit 6e61cf8

Please sign in to comment.