Branch Coverage

blib/lib/HTTP/Date.pm
Criterion Covered Total %
branch 52 60 86.6


line true false branch
23 0 1 unless defined $time
35 1 140 unless defined $str
38 3 137 if ($str =~ /^[SMTWF][a-z][a-z], ([0-9][0-9]) ([JFMAJSOND][a-z][a-z]) ([0-9][0-9][0-9][0-9]) ([0-9][0-9]):([0-9][0-9]):([0-9][0-9]) GMT$/)
43 1 2 $t < 0 ? :
48 11 126 unless @d
52 63 63 unless (defined $tz)
53 20 43 unless (defined($tz = shift()))
58 1 14 $t < 0 ? :
64 73 33 if ($GMT_ZONE{uc $tz}) { }
29 4 elsif ($tz =~ /^([-+])?([0-9][0-9]?):?([0-9][0-9])?$/) { }
70 29 0 if $3
71 9 20 if $1 and $1 eq "-"
74 0 4 unless eval { do { require Time::Zone } }
76 1 3 unless defined $offset
83 1 104 $t < 0 ? :
89 0 149 unless defined $_
99 12 57 unless ($day, $mon, $yr, $hr, $min, $sec, $tz) = m[^ ([0-9][0-9]?) # day (?:\s+|[-/]) (\w+) # month (?:\s+|[-/]) ([0-9]+) # year (?: (?:\s+|:) # separator before clock ([0-9][0-9]?):([0-9][0-9]) # hour:min (?::([0-9][0-9]))? # optional seconds )? # optional clock \s* ([-+]?[0-9]{2,4}|(?![APap][Mm]\b)[A-Za-z]+)? # timezone \s* (?:\(\w+\)|\w{3,})? # ASCII representation of timezone. \s*$ ]x or ($mon, $day, $hr, $min, $sec, $tz, $yr) = /^ (\w{1,3}) # month \s+ ([0-9][0-9]?) # day \s+ ([0-9][0-9]?):([0-9][0-9]) # hour:min (?::([0-9][0-9]))? # optional seconds \s+ (?:([A-Za-z]+)\s+)? # optional timezone ([0-9]+) # year \s*$ # allow trailing whitespace /x or ($mon, $day, $yr, $hr, $min, $sec) = /^ (\w{3}) # month \s+ ([0-9][0-9]?) # day \s+ (?: ([0-9][0-9][0-9][0-9]) | # year ([0-9]{1,2}):([0-9]{2}) # hour:min (?::([0-9][0-9]))? # optional seconds ) \s*$ /x or ($yr, $mon, $day, $hr, $min, $sec, $tz) = m[^ ([0-9]{4}) # year [-/]? ([0-9][0-9]?) # numerical month [-/]? ([0-9][0-9]?) # day (?: (?:\s+|[-:Tt]) # separator before clock ([0-9][0-9]?):?([0-9][0-9]) # hour:min (?::?([0-9][0-9](?:\.[0-9]*)?))? # optional seconds (and fractional) )? # optional clock \s* ([-+]?[0-9][0-9]?:?(?:[0-9][0-9])? |Z|z)? # timezone (Z is "zero meridian", i.e. GMT) \s*$ ]x or ($mon, $day, $yr, $hr, $min, $ampm) = /^ ([0-9]{2}) # numerical month - ([0-9]{2}) # day - ([0-9]{2,4}) # year \s+ ([0-9][0-9]?):([0-9][0-9])([APap][Mm]) # hour:min AM or PM \s*$ /x
209 132 1 defined $yr ? :
214 0 1 if $mon > $cur_mon
229 34 99 unless defined $hr
230 34 99 unless defined $min
231 65 68 unless defined $sec
234 17 116 if ($ampm)
236 10 7 if $hr == 12 and $ampm eq "AM"
237 2 15 if $ampm eq "PM" and $hr != 12
240 131 2 if wantarray
243 0 2 if (defined $tz) { }
244 0 0 if $tz =~ /^(GMT|UTC?|[-+]?0+)$/
257 1 13 unless defined $time
267 1 1 unless defined $time