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 114 unless defined $str
38 1 113 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 107 unless @d
52 51 56 unless (defined $tz)
53 15 36 unless (defined($tz = shift()))
58 0 10 $t < 0 ? :
64 65 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 92 $t < 0 ? :
89 0 116 unless defined $_
99 3 46 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}) # year \s+ (\d\d?):(\d\d)([APap][Mm]) # hour:min AM or PM \s*$ /x
209 109 1 defined $yr ? :
214 0 1 if $mon > $cur_mon
229 32 78 unless defined $hr
230 32 78 unless defined $min
231 53 57 unless defined $sec
234 11 99 if ($ampm)
236 5 6 if $hr == 12 and $ampm eq 'AM'
237 2 9 if $ampm eq 'PM' and $hr != 12
240 108 2 if wantarray
243 0 2 if (defined $tz) { }
244 0 0 if $tz =~ /^(GMT|UTC?|[-+]?0+)$/
257 1 10 unless defined $time
267 1 1 unless defined $time