mirror of https://github.com/gin-gonic/gin.git
add TestDisableBindValidation (#2071)
This commit is contained in:
parent
2e5a7196cc
commit
d6eafcf48a
|
@ -40,6 +40,14 @@ func TestSetMode(t *testing.T) {
|
||||||
assert.Panics(t, func() { SetMode("unknown") })
|
assert.Panics(t, func() { SetMode("unknown") })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestDisableBindValidation(t *testing.T) {
|
||||||
|
v := binding.Validator
|
||||||
|
assert.NotNil(t, binding.Validator)
|
||||||
|
DisableBindValidation()
|
||||||
|
assert.Nil(t, binding.Validator)
|
||||||
|
binding.Validator = v
|
||||||
|
}
|
||||||
|
|
||||||
func TestEnableJsonDecoderUseNumber(t *testing.T) {
|
func TestEnableJsonDecoderUseNumber(t *testing.T) {
|
||||||
assert.False(t, binding.EnableDecoderUseNumber)
|
assert.False(t, binding.EnableDecoderUseNumber)
|
||||||
EnableJsonDecoderUseNumber()
|
EnableJsonDecoderUseNumber()
|
||||||
|
|
Loading…
Reference in New Issue