Branch Coverage

blib/lib/DateTime/TimeZone.pm
Criterion Covered Total %
branch 112 130 86.1


line true false branch
57 541 4212 if (exists $DateTime::TimeZone::Catalog::LINKS{$p{'name'}}) { }
0 4212 elsif (exists $DateTime::TimeZone::Catalog::LINKS{uc $p{'name'}}) { }
64 3539 1214 unless ($p{'name'} =~ m[/] or $SpecialName{$p{'name'}})
66 1018 2521 if ($p{'name'} eq "floating")
70 2 2519 if ($p{'name'} eq "local")
74 2507 12 if ($p{'name'} eq "UTC" or $p{'name'} eq "Z")
81 61 1153 if ($p{'name'} =~ m[Etc/(?:GMT|UTC)(\+|-)(\d{1,2})]i)
85 30 31 $1 eq '-' ? :
87 3 58 unless $hours <= 14
101 1 1152 unless $real_class =~ /^\w+(::\w+)*$/
104 568 584 unless ($real_class->can("instance"))
118 9 559 if ($e)
122 9 0 if ($e =~ /^Can't locate $regex/i) { }
134 1143 0 if ($zone->is_olson)
135 1142 1 $zone->can('olson_version') ? :
141 2 1141 if ($object_version ne $catalog_version)
182 1225 1011 if $self->can($m)
231 246 62 $type eq 'utc' ? :
235 299 9 if ($seconds < $self->max_span->[$end]) { }
248 4 304 unless (defined $span)
250 0 4 if $type eq "utc"
271 253 46 if $max % 2 and $max != 3
273 0 299 if @{$self->{'spans'};} == 1
278 468 1480 if ($seconds < $current->[$start]) { }
1184 296 elsif ($seconds >= $current->[$end]) { }
285 0 468 if $i < $min
294 3 1181 if $i >= $max
301 23 273 if ($current->[5] and $type eq "local")
305 0 23 if $current->[1] == "Inf"
315 0 23 unless defined $next
317 2 21 if (not $next->[5] and $next->[$start] <= $seconds and $seconds <= $next->[$end])
362 482 0 if (@rules == 2) { }
0 0 elsif (@rules == 1) { }
363 241 241 $x ? :
385 22 460 if $next->utc_rd_as_seconds < $self->max_span->[1]
420 9 441 if $seconds >= $span->[$start] and $seconds < $span->[$end]
430 247 62 $_[0] eq 'utc' ? :
460 7 6 $tz && $tz->isa('DateTime::TimeZone') ? :
477 4 0 if ($class->isa(__PACKAGE__)) { }
498 1 272 if &try(sub {
500 0 273 unless defined $offset
502 3 270 if $offset eq 0
505 93 177 if ($offset =~ /^([\+\-])?(\d\d?):(\d\d)(?::(\d\d))?$/) { }
40 137 elsif ($offset =~ /^([\+\-])?(\d\d)(\d\d)(\d\d)?$/) { }
515 16 117 unless defined $sign
516 0 133 unless $hours >= 0 and $hours <= 99
517 18 115 unless $minutes >= 0 and $minutes <= 59
519 6 20 unless not defined $seconds or $seconds >= 0 and $seconds <= 59
522 20 89 if $seconds
523 49 60 if $sign eq "-"
534 1 120 if &try(sub {
537 0 121 unless defined $offset
538 2 119 unless $offset >= -359999 and $offset <= 359999
540 54 65 $offset < 0 ? :
551 21 98 $secs ? :
564 2 1 wantarray ? :
570 1 1 wantarray ? :
575 4 2 wantarray ? :
580 1 2 if $_[0]->isa("DateTime::TimeZone")
581 0 3 unless exists $DateTime::TimeZone::Catalog::CATEGORIES{$_[0]}
585 2 1 wantarray ? :
590 1 0 wantarray ? :
595 1 4 if $_[0]->isa("DateTime::TimeZone")
599 0 5 unless exists $DateTime::TimeZone::Catalog::ZONES_BY_COUNTRY{lc $_[0]}
604 4 1 wantarray ? :