Commit 15c2714c authored by Nigel Kukard's avatar Nigel Kukard

Merge branch 'booleanize-optimization' into 'master'

Interpret 'yes' in booleanize() as positive



See merge request !9
parents 872a01c8 17248883
Pipeline #257 passed with stages
in 1 minute and 46 seconds
......@@ -343,8 +343,8 @@ sub booleanize
# Nuke whitespaces
$var =~ s/\s//g;
# Allow true, on, set, enabled, 1
if ($var =~ /^(?:true|on|set|enabled|1)$/i) {
# Allow true, on, set, enabled, yes, 1
if ($var =~ /^(?:true|on|set|enabled|yes|1)$/i) {
return 1;
}
......
......@@ -48,6 +48,8 @@ is(booleanize("SeT"),1,"Booleanize of 'SeT' should return 1");
is(booleanize("EnAblED"),1,"Booleanize of 'EnAblED' should return 1");
is(booleanize("yes"),1,"Booleanize of 'yes' should return 1");
is(booleanize(1),1,"Booleanize of 1 should return 1");
is(booleanize("1"),1,"Booleanize of '1' should return 1");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment