From c4e7487ba7b3c332f9b914d81ae7025093b23869 Mon Sep 17 00:00:00 2001 From: Philippe ALEXANDRE Date: Tue, 15 May 2018 11:48:49 +0200 Subject: [PATCH] Do case insensitive comparaison for booleans - Fix #125 --- check/test.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/check/test.go b/check/test.go index eaf0a12..4e1507c 100644 --- a/check/test.go +++ b/check/test.go @@ -80,10 +80,20 @@ func (t *testItem) execute(s string) (result bool) { switch t.Compare.Op { case "eq": - result = flagVal == t.Compare.Value + // Do case insensitive comparaison for booleans ... + if value == "false" || value == "true" { + result = value == t.Compare.Value + } else { + result = flagVal == t.Compare.Value + } case "noteq": - result = !(flagVal == t.Compare.Value) + // Do case insensitive comparaison for booleans ... + if value == "false" || value == "true" { + result = !(value == t.Compare.Value) + } else { + result = !(flagVal == t.Compare.Value) + } case "gt": a, b := toNumeric(flagVal, t.Compare.Value)