From caa260f053de2b5ea5c0e33e8dd8cb70e008329d Mon Sep 17 00:00:00 2001 From: pylemon Date: Fri, 27 Mar 2015 13:43:20 +0800 Subject: [PATCH] add tests to ensure bool value require test always return true. --- validation/validation_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/validation/validation_test.go b/validation/validation_test.go index be63ac93..0727fda4 100644 --- a/validation/validation_test.go +++ b/validation/validation_test.go @@ -26,6 +26,12 @@ func TestRequired(t *testing.T) { if valid.Required(nil, "nil").Ok { t.Error("nil object should be false") } + if !valid.Required(true, "bool").Ok { + t.Error("Bool value should always return true") + } + if !valid.Required(false, "bool").Ok { + t.Error("Bool value should always return true") + } if valid.Required("", "string").Ok { t.Error("\"'\" string should be false") }