Branch Coverage

blib/lib/Geo/TCX.pm
Criterion Covered Total %
branch 145 198 73.2


line true false branch
60 5 16 if (ref $first_arg eq 'SCALAR') { }
63 0 16 unless -f $first_arg
70 16 5 if $txt =~ s[(<Creator.*</Creator>)][]
75 21 0 if $txt =~ /(<.xml version[^>]*>)/
76 21 0 if $txt =~ m[(<TrainingCenterDatabase.*</TrainingCenterDatabase>)]
77 12 9 if $txt =~ m[(<Activities.*</Activities>)]
78 12 9 if $txt =~ m[(<Activity.*</Activity>)]
79 9 12 if $txt =~ m[(<Courses.*</Courses>)]
80 9 12 if $txt =~ m[(<Course(?!s).*</Course>)]
83 12 9 if ($o->{'tag_activity'})
84 12 0 if $o->{'tag_activity'} =~ m[<Activity.*<Id>(.*)</Id>]
85 12 0 if $o->{'tag_activity'} =~ /<Activity Sport="([^"]+)"/
89 9 12 if ($o->{'tag_course'})
91 9 0 if $o->{'tag_course'} =~ m[<Course.*<Name>(.*)</Name>]
94 16 5 if $txt =~ m[(<Author.*</Author>)]
95 16 5 if $o->{'tag_author'}
98 12 9 if ($o->{'tag_activity'})
104 29 12 if $i > 0
109 9 12 if ($o->{'tag_course'})
116 9 0 if ($xml_str =~ m[(<Lap>.*</Lap>)]s)
119 0 9 if (@lap_tags == 0)
124 9 0 if ($lap_tags[$i] =~ m[<EndPosition>(.*)</EndPosition>]s)
135 9 0 if ($xml_str =~ m[(<Track>.*</Track>)]s)
140 9 0 if (@lap_tags == 1) { }
144 0 0 if ($i < $#lap_tags) { }
156 0 9 if $i > 0
163 0 21 unless $n
164 11 10 $n > 1 ? :
192 0 2 if $clone->is_course
196 1 1 $opts{'lap'} ? :
201 2 2 if (defined $course) { }
224 0 6 if $@
242 0 53 if not $lap_i or @_
259 93 2 unless @_
283 0 1 if not $i2 or @_
284 0 1 unless $i2 - $i1 == 1
306 0 3 if not $pt_no or @_
325 0 1 if @_
327 1 0 unless ref $to_pt
382 0 5 unless $lap_i
423 5 4 if (ref $_[0] eq 'ARRAY') { }
432 6 3 if $o->is_course or $opts{'course'}
434 0 9 unless $fname
445 6 3 if ($as_course) { }
447 6 0 if (@laps_to_save == 1) { }
449 4 2 if (defined $opts{'course_name'}) { }
451 2 0 if ($o->is_course) { }
477 10 5 unless ($opts{'nosave'})
479 0 10 if -f $fname_lap and not $opts{'force'}
480 0 10 unless open my $fh, ">", $fname_lap
509 1 1 if ($opts{'filename'}) { }
511 0 2 unless $fname
512 0 2 if -f $fname and not $opts{'force'}
516 2 0 if ($o->is_course) { }
523 4 0 if ($lap->is_course) { }
527 4 0 if ($str_lap =~ s[\s*(<Lap>.*</Lap>)\s*(<Track>.*</Track>)\s*][]s) { }
537 2 0 if $str_course_tracks
539 2 0 if ($o->is_course) { }
544 0 2 unless open my $fh, ">", $fname
554 2 9 $opts{'indent'} ? :
555 2 9 $opts{'indent'} ? :
556 8 3 if $o->is_course or $opts{'course'}
571 11 0 if ($o->{'tag_trainingcenterdatabase'} =~ /(<TrainingCenterDatabase[^>]*>)/) { }
581 7 4 if ($o->{'tag_activities'})
582 7 0 if ($o->{'tag_activities'} =~ /(<Activities[^>]*>)/) { }
585 7 0 if ($o->{'tag_activity'} =~ /(<Activity[^>]*>)/) { }
590 4 7 if ($o->{'tag_courses'})
591 4 0 if ($o->{'tag_courses'} =~ /(<Courses[^>]*>)/) { }
594 4 0 if ($o->{'tag_course'} =~ /(<Course(?!s)[^>]*>)/) { }
599 4 7 if ($as_course and not $o->{'tag_courses'})
615 9 2 if $o->{'tag_creator'}
618 9 2 if $o->{'tag_author'}
636 30 26 unless $fname
637 0 26 if @_
639 10 16 if ($o->_is_wd_defined)
644 10 16 if ($wd)
645 8 2 unless ($fname =~ m[^/])
652 0 26 unless -d $o->{'_fileABSOLUTEPATH'}
677 0 79 if @_
680 42 37 if (not $dir) { }
681 28 14 unless $first_call
683 13 1 if ($fname) { }
689 0 37 if $dir =~ /^~/
690 5 32 if $dir eq "-"
692 8 29 if ($dir =~ m[^[^/]])
693 2 6 $first_call ? :
698 0 37 unless -d $dir
700 21 16 if ($first_call) { }
712 37 5 if $dir
746 2 4 if ($activity)
750 4 0 if $o->{'tag_activity'} =~ /<Activity Sport="([^"]*)"/
799 16 0 if ($o->{'tag_author'} =~ m[<Author\s+([^=]+="[^"]+")>(.*)<\/Author>])
804 60 4 if $author_xml =~ m[<$key>(.+)</$key>]
816 0 8 if defined $href->{'key'}
825 0 1 unless %keys_values or $href
826 2 1 if (%keys_values)
828 0 2 unless $possible_author_keys{$key}
840 6 60 if $lap_i < 0
842 0 66 unless $exists{$lap_i}