Skip to content
Snippets Groups Projects
Unverified Commit 82b1e05a authored by Liz Rice's avatar Liz Rice Committed by GitHub
Browse files

Merge pull request #131 from philalex/fixBooleansComparaison-issue125

Fix booleans comparaison issue125
parents c0d80b46 97e5bc9b
No related branches found
No related tags found
No related merge requests found
......@@ -80,10 +80,22 @@ func (t *testItem) execute(s string) (result bool) {
switch t.Compare.Op {
case "eq":
result = flagVal == t.Compare.Value
value := strings.ToLower(flagVal)
// 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)
value := strings.ToLower(flagVal)
// 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment