mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-24 10:58:18 +08:00
add test
This commit is contained in:
parent
f0c42ad917
commit
2a8d39a98b
@ -8,6 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin/binding"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -34,3 +35,9 @@ func TestSetMode(t *testing.T) {
|
|||||||
|
|
||||||
assert.Panics(t, func() { SetMode("unknown") })
|
assert.Panics(t, func() { SetMode("unknown") })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestEnableJsonDecoderUseNumber(t *testing.T) {
|
||||||
|
assert.False(t, binding.EnableDecoderUseNumber)
|
||||||
|
EnableJsonDecoderUseNumber()
|
||||||
|
assert.True(t, binding.EnableDecoderUseNumber)
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user