mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 20:22:20 +08:00
test(form): fix test code for array collection format in form binding
This commit is contained in:
parent
b8cfe5ae4d
commit
70108c0723
@ -15,6 +15,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMappingBaseTypes(t *testing.T) {
|
func TestMappingBaseTypes(t *testing.T) {
|
||||||
@ -288,7 +289,7 @@ func TestMappingCollectionFormat(t *testing.T) {
|
|||||||
"array_tsv": {"1 2"},
|
"array_tsv": {"1 2"},
|
||||||
"array_pipes": {"1|2"},
|
"array_pipes": {"1|2"},
|
||||||
}, "form")
|
}, "form")
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
assert.Equal(t, []int{1, 2}, s.SliceMulti)
|
assert.Equal(t, []int{1, 2}, s.SliceMulti)
|
||||||
assert.Equal(t, []int{1, 2}, s.SliceCsv)
|
assert.Equal(t, []int{1, 2}, s.SliceCsv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user