Branch Coverage

blib/lib/File/DesktopEntry.pm
Criterion Covered Total %
branch 131 172 76.1


line true false branch
93 4 15 if (not defined $file) { }
4 11 elsif (ref $file) { }
10 1 elsif ($file =~ m[[/\\\.]]) { }
107 0 3 if $File::DesktopEntry::AUTOLOAD eq 'DESTROY'
108 0 3 unless $File::DesktopEntry::AUTOLOAD =~ /^[A-Z][A-Za-z0-9-]+$/
123 0 2 if (not $file and $name =~ /-/)
134 10 7 if not $lang or $lang eq 'C' or $lang eq 'POSIX'
135 0 7 unless $lang =~ /^ ([^_\@\.]+) # lang $1 (?: _ ([^\@\.]+) )? # COUNTRY $2 (?: \. [^\@]+ )? # ENCODING (?: \@ (.+) )? # MODIFIER $3 $/x
142 2 5 $m ? :
3 4 $c ? :
1 6 $m && $c ? :
167 0 1 unless length $exec
175 0 1 unless length $exec
213 2 1 if $pid
225 0 7 unless $self->get('Type') eq 'Application'
231 0 7 if ($t and $t eq 'true')
237 3 4 if (my $path = $self->get('Path'))
240 0 3 unless chdir $path
242 0 3 if $VERBOSE
245 0 7 if $VERBOSE
247 2 5 if ($call eq 'exec') { }
249 0 0 if $VERBOSE and $?
251 2 3 if (defined $cwd)
252 0 2 unless chdir $cwd
303 0 62 if not $s =~ /^\%[FUD]$/ and $s =~ /\%[FUD]/
307 1 61 if $s =~ /(\%[^fFuUdDnNickvm])/
311 1 60 if @argv > 1 and $s =~ /\%[fud]/
315 0 60 if $VERBOSE and $s =~ /%([nNvm])/
319 9 12 if ($seen == 0) { }
0 12 elsif ($seen > 1) { }
330 17 50 if (/^\%([FUD])$/) { }
1 49 elsif ($_ eq '%i') { }
331 3 1 $1 eq 'U' ? :
13 4 $1 eq 'F' ? :
337 1 0 if defined $icon
347 1 1 $1 eq 'k' ? :
1 2 $1 eq 'c' ? :
1 3 $1 eq 'd' ? :
1 4 $1 eq 'u' ? :
2 5 $1 eq 'f' ? :
4 7 $1 eq '%' ? :
354 0 21 if (wantarray and $^O eq 'MSWin32')
361 15 6 wantarray ? :
370 33 93 if ($string =~ /^(['"])/)
373 33 0 if defined $1
376 126 0 if defined $1
380 32 95 if (/^(["'])(.*)\1$/s)
392 19 72 if (/([\s"'`\\<>~\|\&;\$\*\?#\(\)])/)
406 7 12 if s[^file:(?://localhost/+|/|///+)(?!/)][/]i
415 2 1 if (-d $_) { }
426 3 3 m[^\w+://] ? :
444 0 3 if ($volume)
474 111 4 @_ == 2 ? :
477 6 109 if ($key =~ /^(.*?)\[(.*?)\]$/)
485 5 110 unless $self->{'groups'}
487 1 114 unless defined $i
491 16 98 unless keys %matches
498 0 28 unless $Chr{$1}
505 0 151 if $group =~ /[\[\]\r\n]/
508 144 14 if $self->{'groups'}[$i] =~ /^\[\Q$group\E\]/
536 32 2 $#_ % 2 ? :
538 4 30 unless $self->{'groups'} or not $self->{'file'}
540 6 28 unless (defined $i)
551 0 48 unless length $word
552 0 48 if $word =~ /[^A-Za-z0-9-]/
554 23 25 if not $group and $k eq 'Exec'
557 23 25 if $self->{'groups'}[$i] =~ s/^\Q$k\E=.*$/$k=$v/m
569 1 2 unless $_[0]{'groups'}
570 0 3 unless $_[0]{'groups'}
594 0 14 unless length $file
597 10 4 if (not ref $file) { }
598 0 10 unless open $fh, "<$file"
601 0 4 unless open $fh, '<', $file
616 32 405 if ($l =~ /^\[(.*?)\]\s*$/)
617 18 14 if length $group
628 0 28 unless defined $self->get($_)
632 0 14 if $enc and $enc ne 'UTF-8'
653 0 1 unless ($self->{'groups'})
654 0 0 if ($self->{'file'}) { }
660 0 2 unless defined $self->get($_)
667 0 1 if not $file && -w $file and defined $self->{'name'}
668 0 1 unless length $file
672 0 1 unless open OUT, ">$file"
673 1 0 unless $] < 5.008
684 1 0 unless (-d $dir)
722 1 1 $group ? :