Branch Coverage

lib/Date/Manip/TZ.pm
Criterion Covered Total %
branch 285 550 51.8


line true false branch
100 509 0 if ($os eq 'Unix') { }
0 0 elsif ($os eq 'Windows') { }
0 0 elsif ($os eq 'VMS') { }
167 57 34 if exists $self->{'data'}{'Offsets'}{$offset}
180 0 1635 if exists $self->{'data'}{'Zones'}{$zone}{'Loaded'}
203 1 48040 if (exists $self->{'data'}{'MyAlias'}{$zone}) { }
47990 50 elsif (exists $self->{'data'}{'Alias'}{$zone}) { }
226 1 1 if ($alias eq "reset")
231 0 1 if (lc $zone eq "reset")
239 0 1 unless $zone
249 2 4 if ($abbrev eq "reset")
254 1 3 if ($#zone == 0 and lc $zone[0] eq "reset")
260 0 3 unless (exists $self->{'data'}{'Abbrev'}{$abbrev})
268 0 5 unless $zone
269 0 5 unless exists $zone{$zone}
270 0 5 if exists $z{$zone}
284 10 12 if (lc $offset eq "reset")
288 0 12 if ($#args == 0 and lc $args[0] eq "reset")
296 0 12 if (ref $offset) { }
301 1 11 unless $offset
302 1 10 unless exists $self->{'data'}{'Offmod'}{$offset}
309 10 0 if ($args[0] =~ /^std|dst|stdonly|dstonly$/i)
311 3 7 if ($tmp eq 'stdonly') { }
2 5 elsif ($tmp eq 'dstonly') { }
319 2 8 if ($#isdst == 0 and not exists $self->{'data'}{'Offsets'}{$offset}{$isdst[0]})
328 0 16 unless exists $self->{'data'}{'Offsets'}{$offset}{$isdst}
335 2 13 if (not exists $self->{'data'}{'ZoneNames'}{$lcz}) { }
1 12 elsif (not exists $tmp{'0'}{$lcz} || exists $tmp{'1'}{$lcz}) { }
2 17 elsif ($#isdst == 0 and not exists $tmp{$isdst[0]}{$lcz}) { }
352 6 4 if exists $tmp{$isdst}{$z}
368 0 0 if ($reset)
379 0 0 if (${^TAINT})
405 0 512 $isdst ? :
408 0 512 $ENV{'DATE_MANIP_DEBUG'} ? :
411 512 0 if defined $self->{'data'}{'path'}
418 0 2000 if $debug
420 512 1488 if ($method eq 'main') { }
512 976 elsif ($method eq 'env') { }
976 0 elsif ($method eq 'file') { }
0 0 elsif ($method eq 'tzdata') { }
0 0 elsif ($method eq 'command') { }
0 0 elsif ($method eq 'cmdfield') { }
0 0 elsif ($method eq 'gmtoff') { }
0 0 elsif ($method eq 'registry') { }
422 0 512 unless (@methods)
423 0 0 if $debug
428 0 512 if $debug
432 0 512 if (defined $val) { }
434 0 0 if $debug
436 0 512 if $debug
440 0 512 if (@methods < 2)
441 0 0 if $debug
446 0 512 if $debug
448 0 512 if ($type ne "zone" and $type ne "offset")
450 0 0 if $debug
456 0 512 if $debug
457 24 488 if (exists $ENV{$var}) { }
458 24 0 if ($type eq 'zone') { }
460 0 24 if $debug
463 0 0 if $debug
466 0 0 if $debug
470 0 488 if $debug
474 0 976 unless (@methods)
475 0 0 if $debug
480 0 976 if $debug
481 488 488 unless (-f $file)
482 0 488 if $debug
487 0 488 unless $in->open($file)
494 0 488 if $line =~ /^\s*\043/ or $line =~ /^\s*$/
496 488 0 if ($firstline)
531 0 488 if ($line =~ /^\s*(?:TZ|TIMEZONE|ZONE)\s*=\s*(.*)\s*$/)
534 0 0 unless $val
536 0 0 if ($val =~ /^(["'])(.*?)\1/) { }
0 0 elsif ($val =~ /\s/) { }
538 0 0 unless $z
557 488 0 if @z
559 0 488 if ($debug)
560 0 0 if (@zone) { }
568 0 0 if (@methods < 2)
569 0 0 if $debug
575 0 0 if $debug
578 0 0 if (-f $file and -d $dir)
581 0 0 if (defined $z) { }
0 0 elsif ($debug) { }
583 0 0 if $debug
589 0 0 unless (@methods)
590 0 0 if $debug
595 0 0 if $debug
597 0 0 if $out
599 0 0 if ($debug)
600 0 0 if ($out) { }
608 0 0 if ($#methods < 1)
609 0 0 if $debug
615 0 0 if $debug
619 0 0 if ($out)
623 0 0 if defined $out[$n]
627 0 0 if ($debug)
628 0 0 if ($val) { }
636 0 0 if $debug
639 0 0 if ($mdayUT > $mday + 1) { }
0 0 elsif ($mdayUT < $mday - 1) { }
653 0 0 if $debug
656 0 0 if $debug
658 0 0 if ($z) { }
660 0 0 if $debug
662 0 0 if $debug
666 0 0 if $debug
679 512 0 if $currzone
682 0 0 if (exists $self->{'data'}{'Abbrev'}{$zone})
690 0 0 if $currzone
694 0 512 unless ($currzone)
717 0 0 unless -d $zoneinfo and -f $localtime
720 0 0 if (-l $localtime)
734 0 0 if eval { do { require File::Find; File::Find::find({"wanted", \&Date::Manip::TZ::_zoneinfo_find_file, "no_chdir", 1}, $zoneinfo); 1 } }
746 0 0 if ref $@
752 0 0 if defined($zone = _zoneinfo_file_name_to_zone($File::Find::name, $zoneinfo)) and -f $_ and $want_size == -s _ and $want_content eq _zoneinfo_file_slurp($File::Find::name)
766 0 0 if exists $Date::Manip::Zones::ZoneNames{lc $zone} or exists $Date::Manip::Zones::Alias{lc $zone}
772 0 0 unless open my $fh, "<", $file
784 0 0 unless my $lmachine = "Win32::TieRegistry"->new("LMachine", {"Access", Win32::TieRegistry::KEY_READ(), "Delimiter", "/"})
796 0 0 if (defined $tzkn and $tzkn)
802 0 0 if ($i != -1)
806 0 0 if $z
815 0 0 if $z
823 0 0 unless (defined $atz and $atz)
827 0 0 unless defined $atz and $atz
832 0 0 if $znam eq $stdnam
846 0 0 unless open IN, "$cmd |"
861 1 61 unless (@args)
873 34 72 if (ref $arg eq 'ARRAY') { }
0 72 elsif (ref $arg) { }
874 34 0 if ($#$arg == 5) { }
0 0 elsif ($#$arg == 2) { }
876 0 34 if @$date
881 0 0 if $offset
883 0 0 unless $offset
895 11 61 if ($arg =~ /^(std|dst|stdonly|dstonly)$/) { }
15 46 elsif ($tmp = $self->_zone($arg)) { }
13 33 elsif (exists $self->{'data'}{'MyAbbrev'}{$arg} or exists $self->{'data'}{'Abbrev'}{$arg}) { }
0 33 elsif (exists $self->{'data'}{'Abbrev'}{$arg}) { }
30 3 elsif ($tmp = $dmb->split('offset', $arg)) { }
0 3 elsif ($tmp = $dmb->split('date', $arg)) { }
896 0 11 if $dstflag
900 0 15 if $zone
905 0 13 if $abbrev
908 0 0 if $abbrev
912 0 30 if $offset
916 0 0 if $date
948 3 68 unless ($zone or $abbrev or $offset)
961 70 12 if $offset and @$date and not $dstflag
964 4 557 if ($dstflag eq 'stdonly') { }
4 553 elsif ($dstflag eq 'dstonly') { }
71 482 elsif ($dstflag eq 'dst') { }
977 372 189 if ($zone and not $abbrev)
978 372 0 if (exists $self->{'data'}{'Alias'}{$zone}) { }
0 0 elsif (exists $self->{'data'}{'MyAbbrev'}{$zone} or exists $self->{'data'}{'Abbrev'}{$zone}) { }
989 372 189 if ($zone)
991 372 0 exists $self->{'data'}{'Alias'}{$zone} ? :
997 118 443 if ($abbrev)
999 8 110 if (exists $self->{'data'}{'MyAbbrev'}{$abbrev}) { }
110 0 elsif (exists $self->{'data'}{'Abbrev'}{$abbrev}) { }
1008 155 81 if (@tmp)
1009 37 118 if (@z) { }
1017 0 118 if (@zone) { }
1022 0 118 unless @zone
1027 82 479 if ($offset)
1028 1 81 unless exists $self->{'data'}{'Offmod'}{$offset}
1037 28 127 if ($abbrev) { }
1040 125 2 if $tmp
1043 134 21 if (@tmp)
1044 55 79 if (@z) { }
1052 14 67 if (@zone) { }
1057 2 79 unless @zone
1062 533 25 if (@$date)
1072 0 533 if $dstflag eq "stdonly"
1073 0 533 if $dstflag eq "dstonly"
1077 850 3279 unless exists $self->{'data'}{'Zones'}{$z}{'Loaded'}
1082 650 2234 if $abbrev ne "" and lc $abbrev ne lc $period->[4] or $offset ne "" and $offset ne $period->[2] or $isdst ne "" and $isdst ne $period->[5] or $dmb->cmp($date, $period->[1]) == -1 or $dmb->cmp($date, $period->[7]) == 1
1093 9 524 unless @zone
1101 27 533 if (wantarray)
1109 9 524 unless @zone
1122 597 3019 unless exists $self->{'data'}{'Zones'}{$zone}{'Loaded'}
1128 319842 1845 if lc $abbrev ne lc $abb or $isdst != $dst
1147 126 678 unless exists $self->{'data'}{'Zones'}{$zone}{'Loaded'}
1153 6888 185 if lc $abbrev ne lc $abb or $offset ne $off or $isdst != $dst
1173 182 39 if exists $list2{$ele}
1186 477 1316 if exists $list1{$ele}
1201 0 7 unless ($z)
1206 0 7 unless exists $self->{'data'}{'Zones'}{$zone}{'Loaded'}
1225 3145 31199 unless (exists $self->{'data'}{'Zones'}{$zone}{'AllDates'}{$year})
1234 5 3140 if ($year > $self->{'data'}{'LastYear'} and exists $self->{'data'}{'Zones'}{$zone}{'LastRule'}{'zone'}) { }
1242 112940 2221 if ($y < $year)
1246 1895 326 if $year == $y
1250 3 3142 unless $ym1
1260 3142 3 if ($ym1)
1262 3142 0 if @tmp
1269 1900 1245 if ($ym0)
1283 0 8 unless ($z)
1288 1 7 unless exists $self->{'data'}{'Zones'}{$zone}{'Loaded'}
1290 7 1 unless (defined $year1)
1294 1 0 unless defined $year
1299 1 0 if ($year <= $lastyear)
1302 1 3 if $y > $year1 or $y > $lastyear
1303 0 3 if $y < $year
1308 0 1 if ($year1 > $lastyear)
1309 0 0 if $year <= $lastyear
1322 12 5040 unless (exists $self->{'data'}{'Zones'}{$zone}{'Dates'}{$year})
1325 11 1 if ($year > $self->{'data'}{'LastYear'})
1345 5550 24658 unless $wallclock
1346 29926 282 unless $isdst
1349 0 30208 unless ($z)
1354 61 30147 unless exists $self->{'data'}{'Zones'}{$zone}{'Loaded'}
1360 0 30208 if $year < 0 or $year > 9999
1362 24658 5550 if ($wallclock) { }
1368 0 24658 if (($dates cmp $beg) == -1) { }
0 24658 elsif (($dates cmp $end) == 1) { }
1378 24690 45275 if (($dates cmp $begLTs) != -1 and ($dates cmp $endLTs) != 1)
1383 8 24650 if ($#per == -1) { }
24610 40 elsif ($#per == 0) { }
40 0 elsif ($#per == 1) { }
1388 19 21 if ($per[0][5] == $isdst) { }
1405 5550 209 if (($dates cmp $begUTs) != -1 and ($dates cmp $endUTs) != 1)
1436 0 22 unless @mon
1470 11 22 if $endonly
1472 11 11 if (@period)
1476 11 11 $isdst ? :
1510 0 2860 if $err
1514 0 2860 unless ($from)
1523 0 12 if $err
1527 7 5 unless ($to)
1536 0 27 if $err
1540 0 27 unless ($from)
1549 0 0 if $err
1553 0 0 unless ($to)
1562 7 2892 if ($#args == -1) { }
176 2716 elsif ($#args == 0) { }
2716 0 elsif ($#args == 1) { }
1565 0 176 if ($args[0] eq '0' or $args[0] eq '1') { }
1584 5735 1 if (ref $date) { }
1591 5736 0 if ($from ne $to)
1593 0 5736 unless ($tmp)
1599 0 5736 unless ($tmp)
1605 187 5549 if ($from eq $to)
1614 5549 0 if ($from ne "Etc/GMT")
1616 2 5547 unless ($per)
1629 5547 0 if ($to ne "Etc/GMT")
1664 465 79 if defined $self->{'data'}{$re}
1669 0 79 if (exists $ENV{'DATE_MANIP_DEBUG_ZONES'}) { }
1691 0 79 if (exists $ENV{'DATE_MANIP_DEBUG_ABBREVS'}) { }
1759 0 384 if ($var eq 'tz') { }
169 215 elsif ($var eq 'setdate') { }
188 27 elsif ($var eq 'forcedate') { }
27 0 elsif ($var eq 'configfile') { }
1761 0 0 if $err
1767 0 169 if $err
1773 0 188 if $err
1803 267 90 if ($val =~ /^now$dstrx$zonrx$/io) { }
0 90 elsif ($val =~ /^zone$dstrx$zonrx$/io) { }
90 0 elsif ($val =~ /^$da1rx$dstrx$zonrx$/o or $val =~ /^$da2rx$dstrx$zonrx$/o) { }
0 0 elsif ($val =~ /^$da1rx$/o or $val =~ /^$da2rx$/o) { }
0 0 elsif (lc $val eq 'now') { }
1854 357 0 unless $dstflag
1860 267 90 if ($op eq 'nowzone') { }
0 90 elsif ($op eq 'zone') { }
1881 357 0 if ($zone) { }
1884 0 357 unless defined $date
1886 0 357 unless ($zone)
1900 357 0 if ($dstflag eq 'std') { }
0 0 elsif ($dstflag eq 'stdonly') { }
0 0 elsif ($dstflag eq 'dst') { }
1910 357 0 if ($op eq 'nowzone' or $op eq 'datezone' or $op eq 'date') { }
0 0 elsif ($op eq 'zone') { }
1917 357 357 if $per
1921 0 357 unless ($per)
1934 0 0 if ($err)
1954 188 169 if ($force) { }