Branch Coverage

blib/lib/HTTP/Date.pm
Criterion Covered Total %
branch 45 60 75.0


line true false branch
23 0 1 unless defined $time
35 1 120 unless defined $str
38 1 119 if ($str =~ /^[SMTWF][a-z][a-z], (\d\d) ([JFMAJSOND][a-z][a-z]) (\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$/)
43 0 1 $t < 0 ? :
48 6 113 unless @d
52 57 56 unless (defined $tz)
53 18 39 unless (defined($tz = shift()))
58 0 13 $t < 0 ? :
64 68 27 if ($GMT_ZONE{uc $tz}) { }
27 0 elsif ($tz =~ /^([-+])?(\d\d?):?(\d\d)?$/) { }
70 27 0 if $3
71 9 18 if $1 and $1 eq "-"
74 0 0 unless eval { do { require Time::Zone } }
76 0 0 unless defined $offset
83 0 95 $t < 0 ? :
89 0 122 unless defined $_
99 3 52 unless ($day, $mon, $yr, $hr, $min, $sec, $tz) = m[^ (\d\d?) # day (?:\s+|[-/]) (\w+) # month (?:\s+|[-/]) (\d+) # year (?: (?:\s+|:) # separator before clock (\d\d?):(\d\d) # hour:min (?::(\d\d))? # optional seconds )? # optional clock \s* ([-+]?\d{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+ (\d\d?) # day \s+ (\d\d?):(\d\d) # hour:min (?::(\d\d))? # optional seconds \s+ (?:([A-Za-z]+)\s+)? # optional timezone (\d+) # year \s*$ # allow trailing whitespace /x or ($mon, $day, $yr, $hr, $min, $sec) = /^ (\w{3}) # month \s+ (\d\d?) # day \s+ (?: (\d\d\d\d) | # year (\d{1,2}):(\d{2}) # hour:min (?::(\d\d))? # optional seconds ) \s*$ /x or ($yr, $mon, $day, $hr, $min, $sec, $tz) = m[^ (\d{4}) # year [-/]? (\d\d?) # numerical month [-/]? (\d\d?) # day (?: (?:\s+|[-:Tt]) # separator before clock (\d\d?):?(\d\d) # hour:min (?::?(\d\d(?:\.\d*)?))? # optional seconds (and fractional) )? # optional clock \s* ([-+]?\d\d?:?(:?\d\d)? |Z|z)? # timezone (Z is "zero meridian", i.e. GMT) \s*$ ]x or ($mon, $day, $yr, $hr, $min, $ampm) = /^ (\d{2}) # numerical month - (\d{2}) # day - (\d{2,4}) # year \s+ (\d\d?):(\d\d)([APap][Mm]) # hour:min AM or PM \s*$ /x
209 115 1 defined $yr ? :
214 0 1 if $mon > $cur_mon
229 32 84 unless defined $hr
230 32 84 unless defined $min
231 59 57 unless defined $sec
234 17 99 if ($ampm)
236 10 7 if $hr == 12 and $ampm eq "AM"
237 2 15 if $ampm eq "PM" and $hr != 12
240 114 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