Branch Coverage

blib/lib/Rose/DateTime/Util.pm
Criterion Covered Total %
branch 90 120 75.0


line true false branch
33 2 7 if @_
41 9 5 if (@_)
43 6 3 if (defined $_[0])
45 3 3 $_[0] ? :
60 0 6 unless (ref $locale_class)
66 6 0 $locale_class->can('date_format_short') ? :
76 1 5 if ($short eq 'dmy')
103 3 2771 if (ref $arg and $arg->isa('DateTime')) { }
394 2377 elsif (($year, $month, $mday, $hours, $mins, $secs, $fsecs, $ampm, $hours2, $ampm2) = $arg =~ m[ ^ (\d{4}) \s* [-._]? \s* # year (\d{2}) \s* [-._]? \s* # month (\d{2}) # day (?: \s* [-._T]? \s* (?: (\d\d?) : # hour (\d\d) # min (?: (?: : (\d\d) )? (?: \. (\d{0,9}) )? )? # sec? nanosec? (?: \s* ([aApP]\.?[mM]\.?) )? # am/pm? | (\d\d?) # hour (?: \s* ([aApP]\.?[mM]\.?) ) # am/pm ) )? $ ]x) { }
2364 13 elsif (($month, $mday, $year, $hours, $mins, $secs, $fsecs, $ampm) = $arg =~ m[ ^ (\d{1,2}) [-/._] (\d{1,2}) [-/._] (\d{4}) # xx-xx-yyyy (?: (?: \s+ | [-._T] ) (\d\d?) # hour (?::(\d\d)(?::(\d\d))?)?(?:\.(\d{0,9}))? # min? sec? nanosec? (?:\s*([aApP]\.?[mM]\.?))? # am/pm )? $ ]x) { }
1 12 elsif (lc $arg eq 'now' or lc $arg eq 'now!') { }
8 4 elsif ($arg =~ /^(?: (-?\d+)(?:\.(\d{0,9}))? | (-?\d*)\.(\d{1,9}) )$/x) { }
1 3 elsif ($arg =~ /^today$/i) { }
2 1 elsif ($arg =~ /^(-)?infinity$/i) { }
105 2 1 if (@_ > 1)
116 1 1 if ($error)
148 5 389 if defined $hours2
149 5 389 if defined $ampm2
169 1546 818 if ($European_Dates)
183 7 1 defined $1 ? :
184 6 2 defined $2 ? :
186 0 8 if $epoch eq '-'
191 6 2 if ($fsecs)
195 3 3 if ($len < 9) { }
0 3 elsif ($len > 9) { }
216 1 1 if ($1)
225 0 1 $Error ? :
230 0 2759 unless ($date)
232 0 0 $Error ? :
252 1 0 if ($arg =~ /^(?: (-?\d+)(?:\.(\d{0,9}))? | (-?\d*)\.(\d{1,9}) )$/x) { }
254 1 0 defined $1 ? :
255 0 1 defined $2 ? :
257 0 1 if $epoch eq '-'
262 0 1 if ($fsecs)
266 0 0 if ($len < 9) { }
0 0 elsif ($len > 9) { }
285 0 0 unless ($date)
287 0 0 $Error ? :
301 0 74 unless defined $date
304 0 74 unless (ref $date and $date->isa('DateTime'))
309 1 73 if $date->isa('DateTime::Infinite::Past')
310 1 72 if $date->isa('DateTime::Infinite::Future')
317 31 43 if ($format =~ /%[EFf]/)
319 31 0 unless (%formats)
330 3 28 if ($mday =~ /(?
2 26 elsif ($mday =~ /(?
2 24 elsif ($mday =~ /(?
350 1 71 wantarray ? :
363 54 2704 unless defined $hours
365 2022 736 if (defined $fsecs) { }
369 1348 674 if ($len < 9) { }
0 674 elsif ($len > 9) { }
383 64 2694 unless defined $secs
384 61 2697 unless defined $mins
386 1352 1406 if ($ampm)
388 1349 3 if ($ampm =~ /^p/i) { }
0 3 elsif ($hours == 12) { }
390 1349 0 unless $hours == 12
419 0 2758 if ($error)
422 0 0 if $Debug