aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoomtrain14 <yet.ebreo@gmail.com>2021-02-19 10:57:21 +0800
committerDoomtrain14 <yet.ebreo@gmail.com>2021-02-19 10:57:21 +0800
commit72209dc06a802d269a2adbd0265066cd75d8a9d5 (patch)
tree680b65e80524ed867a6daf2a582cae3e37b41b7d
parentafab67673cd0533780c8b7dc38835caba7ee3491 (diff)
downloadperlweeklychallenge-club-72209dc06a802d269a2adbd0265066cd75d8a9d5.tar.gz
perlweeklychallenge-club-72209dc06a802d269a2adbd0265066cd75d8a9d5.tar.bz2
perlweeklychallenge-club-72209dc06a802d269a2adbd0265066cd75d8a9d5.zip
Added few tests
-rw-r--r--challenge-100/yet-ebreo/perl/ch-1.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/challenge-100/yet-ebreo/perl/ch-1.pl b/challenge-100/yet-ebreo/perl/ch-1.pl
index 515b224531..569125e669 100644
--- a/challenge-100/yet-ebreo/perl/ch-1.pl
+++ b/challenge-100/yet-ebreo/perl/ch-1.pl
@@ -14,9 +14,12 @@ use feature qw(say);
# Output: 07:15 pm or 07:15pm
#one-liner? sure thing! :D
-sub f { pop=~/:.. */&&sprintf"%02d%s",$`%12+12*($'?'pm'eq$':!($`%12)),$&.($`<12?'am':'pm')x!$' }
+sub f { pop=~/:.. */&&sprintf"%02d%s",$`%12+12*($'?'pm'eq$':$`%12<1),$&.($`<12?'am':'pm')x!$' }
say &f('01:00 pm');
say &f('12:01 am');
+say &f('12:00 pm');
+say &f('12:00 am');
say &f('13:00');
say &f('00:00');
+say &f('19:15');