mirror of
https://github.com/gin-gonic/gin.git
synced 2025-12-11 19:47:00 +08:00
test(binding): use 'any' alias and require.NoError in form mapping tests
- Replace 'interface{}' with 'any' alias in bindTestData struct
- Change assert.NoError to require.NoError in TestMappingTimeUnixNano and TestMappingTimeDuration to fail fast on mapping errors
This commit is contained in:
parent
2891214fac
commit
af5561cdbc
@ -227,8 +227,8 @@ func TestMappingTime(t *testing.T) {
|
||||
}
|
||||
|
||||
type bindTestData struct {
|
||||
need interface{}
|
||||
got interface{}
|
||||
need any
|
||||
got any
|
||||
in map[string][]string
|
||||
}
|
||||
|
||||
@ -245,7 +245,7 @@ func TestMappingTimeUnixNano(t *testing.T) {
|
||||
|
||||
for _, v := range tests {
|
||||
err := mapForm(v.got, v.in)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, v.need, v.got)
|
||||
}
|
||||
}
|
||||
@ -272,7 +272,7 @@ func TestMappingTimeDuration(t *testing.T) {
|
||||
|
||||
for _, v := range tests {
|
||||
err := mapForm(v.got, v.in)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, v.need, v.got)
|
||||
}
|
||||
// error
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user