Branch Coverage

lib/Class/Usul/Time.pm
Criterion Covered Total %
branch 61 108 56.4


line true false branch
26 28 0 $period && $period =~ / \A [\d._]+ \z /msx && $period > 0 ? :
35 2 3 unless defined $time
37 2 1 unless $_datetime_loaded
57 0 11 unless defined $dtstr and length $dtstr
85 8 3 if $zone
94 0 11 unless $dtstr =~ / \S /mx
96 3 8 if ($dtstr =~ s/ \s (\d{4}) ([-:]?) # ccyy + optional separator - or : (1) (\d\d?) \2 # mm(1 - 12) + same separator (1) (\d\d?) # dd(1 - 31) (?:[Tt ] (\d\d?) # H or HH (?:([-:]?) # Optionally separator - or : (2) (\d\d?) # and M or MM (?:\6 # Optionally same separator (2) (\d\d?) # and S or SS (?:[.,] # Optionally separator . or , (\d+) )? # and fractions of a second )? )? )? (?=\D) / /mx)
114 8 3 unless (defined $hh)
115 3 5 if ($dtstr =~ s/ [:\s] (\d\d?) : (\d\d?) ( : (\d\d?) (?:\.\d+)? )? \s* (?:([ap]) \.?m?\.? )? \s / /mox) { }
0 5 elsif ($dtstr =~ s/ \s (\d\d?) \s* ([ap]) \.?m?\.? \s / /mox) { }
118 0 3 if $5
126 0 6 if (defined $hh and $hh <= 12 and $dtstr =~ s/ ([ap]) \.?m?\.? \s / /mox)
130 8 3 unless (defined $year)
132 0 8 if ($dtstr =~ s/ \s (\d\d?) ([^\d_]) ($monpat) (\2(\d\d+))? \s/ /mox)
137 6 2 if ($dtstr =~ s[ \s (\d+) ([\-\./]) (\d\d?) (\2(\d+))? \s ][ ]mox)
139 2 4 if $day > 31
141 0 6 if length $year > 2 and $year < 1901
145 0 2 if ($dtstr =~ s/ \s (\d+) \s* ($sufpat)? \s* ($monpat) / /mox)
150 0 2 if ($dtstr =~ s/ ($monpat) \s* (\d+) \s* ($sufpat)? \s / /mox)
155 0 2 if ($dtstr =~ s/ \s (\d\d) (\d\d) (\d\d) \s / /mox)
160 0 8 if (not defined $year and $dtstr =~ s/ \s (\d{2} (\d{2})?)[\s\.,] / /mox)
165 0 11 if $dtstr =~ s/ \b ($dstpat) \b //mox
167 3 8 if ($dtstr =~ s/ \s \"? ([a-z]{3,4}) ($dstpat|\d+[a-z]*|_[a-z]+)? \"? \s / /mox) { }
0 8 elsif ($dtstr =~ s/ \s ([a-z]{3,4})? ([\-\+]?) -? (\d\d?) :? (\d\d)? (00)? \s / /mox) { }
170 0 3 if $2 and $2 =~ / $dstpat /msx
172 2 1 unless defined $zone
178 0 0 unless defined $zone
181 0 0 defined $4 ? :
185 0 9 if ($dtstr =~ / \S /msx)
186 0 0 if ($dtstr =~ s/ \A \s*(ut?|z)\s* \z //msx) { }
0 0 elsif ($dtstr =~ s/ \s ([a-z]{3,4})? ([\-\+]?) -? (\d\d?) (\d\d)? (00)? \s / /mox) { }
193 0 0 unless defined $zone
196 0 0 defined $4 ? :
200 0 0 if $dtstr =~ / \S /mox
203 6 3 if (defined $hh)
204 0 1 if $merid == $AM
1 5 if ($hh == 12) { }
0 5 elsif ($merid == $PM) { }
210 0 9 if defined $zone and $dst
211 0 9 unless defined $month
212 0 9 unless defined $day
214 0 9 unless (defined $year)
215 0 0 $month > $lt[4] ? :
218 3 6 unless defined $hh
219 3 6 unless defined $mm
220 4 5 unless defined $ss
221 9 0 unless defined $frac
223 0 9 unless $month <= 11 and $day >= 1 and $day <= 31 and $hh <= 23 and $mm <= 59 and $ss <= 59
226 9 0 if (defined $zone) { }
232 0 9 if not defined $result or $result == -1 and join('', $ss, $mm, $hh, $day, $month, $year) ne '595923311169'
245 0 0 if not defined $result or $result == -1 and join('', $ss, $mm, $hh, $day, $month, $year) ne join('', (localtime -1)[0..5])
257 0 1 unless defined $time
259 1 0 unless $_time_piece_loaded
262 1 0 $zone ? :