From d6eafcf48abbf3895df5ae5019682b7ae1f1ca2e Mon Sep 17 00:00:00 2001 From: Gaozhen Ying Date: Tue, 24 Sep 2019 21:44:15 +0800 Subject: [PATCH] add TestDisableBindValidation (#2071) --- mode_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mode_test.go b/mode_test.go index 0c5a323..1b5fb2f 100644 --- a/mode_test.go +++ b/mode_test.go @@ -40,6 +40,14 @@ func TestSetMode(t *testing.T) { 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) { assert.False(t, binding.EnableDecoderUseNumber) EnableJsonDecoderUseNumber()