Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
awit-frameworks
awit-perl-toolkit
Commits
17248883
Commit
17248883
authored
Sep 18, 2016
by
Nigel Kukard
Browse files
Interpret 'yes' in booleanize() as positive
parent
872a01c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/AWITPT/Util.pm
View file @
17248883
...
...
@@ -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
;
}
...
...
t/booleanize.t
View file @
17248883
...
...
@@ -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
");
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment