Branch Coverage

blib/lib/Locale/XGettext.pm
Criterion Covered Total %
branch 119 236 50.4


line true false branch
43 217 222 if defined $what and length $what
52 0 52 if (ref $class) { }
63 0 52 if ('Locale::XGettext' eq ref $self)
70 49 3 if &__empty($options->{'default_domain'})
71 0 52 if &__empty($options->{'default_domain'})
72 49 3 if &__empty($options->{'output_dir'})
74 0 52 if (exists $options->{'add_location'})
76 0 0 if (&__empty($option))
79 0 0 if $option ne 'full' and $option ne 'file' and $option ne 'never'
83 4 48 if (exists $options->{'add_comments'})
84 0 4 if (not ref $options->{'add_comments'} and 'ARRAY' ne $options->{'add_comments'})
95 52 0 if &__empty($options->{'from_code'})
100 0 52 if ($cd->getError) { }
111 39 13 if ($self->needInputFiles)
113 0 0 unless @{$self->{'__files'};} or @{$options->{'files_from'};}
119 1 51 if (exists $options->{'exclude_file'} and not ref $options->{'exclude_file'})
132 0 0 if (ref $class) { }
139 0 0 if ($@)
143 0 0 if $options{'help'}
145 0 0 if ($options{'version'})
164 0 45 if ($self->{'__run'}++)
171 1 44 if ($self->option('join_existing'))
173 0 1 if ('-' eq $output_file)
181 0 40 unless my $path = $self->resolveFilename($filename)
184 0 40 if ($path =~ /\.pot?$/i) { }
195 44 1 if ($po->entries || $self->{'__options'}{'force_po'} and not $self->{'__options'}{'omit_header'})
214 3 38 length $directory ? :
216 40 1 if stat $path
229 0 1 unless my $entries = 'Locale::PO'->load_file_asarray($path)
234 1 1 if ('""' eq $entry->msgid and &__empty(scalar $entry->dequote($entry->msgctxt)))
247 0 55 unless ($self->{'__run'})
254 0 55 unless (ref $entry)
261 6 49 if (defined $comment)
274 0 13 if ($token eq 'fuzzy') { }
0 13 elsif ($token eq 'no-wrap') { }
0 13 elsif ($token eq 'wrap') { }
1 12 elsif ($token =~ /^[a-z]+-(?:format|check)$/) { }
289 1 1 if not $valid
296 5 1 if (not &__empty($comment) and defined $comment_keywords)
299 5 1 if ($comment =~ /($keyword.*)/s)
306 1 4 unless &__empty($old_automatic)
307 5 0 if @automatic
312 55 0 unless (&__empty($msgid))
314 55 0 if &__empty($ctx)
316 1 54 if exists $self->{'__exclude'}{$msgid}{$ctx}
368 6 92 if &__empty($from_code)
372 0 98 if ($from_code ne 'US-ASCII' and $from_code ne 'UTF-8')
374 0 0 if defined $cd->getError
380 147 245 defined $_ ? :
385 98 0 if ($from_code eq 'US-ASCII') { }
0 0 elsif ($from_code eq 'UTF-8') { }
388 0 98 unless ($flesh =~ /^[\000-\177]*$/)
399 0 0 unless (utf8::valid($flesh))
406 0 0 unless (&__empty($msgid))
407 0 0 unless $cd->recode($msgid)
413 0 0 unless (&__empty($msgid_plural))
414 0 0 unless $cd->recode($msgid_plural)
420 0 0 unless (&__empty($msgstr))
421 0 0 unless $cd->recode($msgstr)
427 0 0 if ($msgstr_n)
429 0 0 unless $cd->recode($msgstr_0)
432 0 0 unless $cd->recode($msgstr_1)
441 0 0 unless $cd->recode($comment)
456 51 98 unless exists $self->{'__options'}{$key}
472 0 9 unless ($self->{'__run'})
477 0 9 unless ($self->{'__po'})
482 0 0 unless $self->{'__po'}->entries or $self->{'__options'}{'force_po'}
487 0 9 unless open my $fh, '>', $filename
492 0 18 unless print $fh $entry->dump
496 0 9 unless close $fh
512 0 0 if @options & 3
528 0 0 unless $options
538 0 0 $lineno ? :
539 0 0 if ($pos < $limit)
548 0 0 if (@description and $pos > 77 - length($description[-1]))
580 0 0 unless defined $version
608 51 1 unless $files
611 0 1 unless my $entries = 'Locale::PO'->load_file_asarray($file)
617 0 2 if &__empty($msgid)
620 1 1 if &__empty($ctx)
632 54 1 unless (&blessed($entry))
637 7 47 if (defined $keyword)
639 7 0 if (exists $keywords->{$keyword})
641 2 5 unless &__empty($comment)
647 2 7 if $keyword ne $flag->function
648 1 6 if $flag->arg != $sg_arg and $flag->arg != $pl_arg
650 0 6 if $flag->no
657 2 52 if (defined $flags)
660 3 0 unless $po_entry->has_flag($flag)
669 0 101 if $@
691 3 7 if (exists $options->{'output'}) { }
1 6 elsif ('-' eq $options->{'default_domain'}) { }
692 1 2 if ('File::Spec'->file_name_is_absolute($options->{'output'}) or '-' eq $options->{'output'}) { }
714 3 41 if ($options->{'foreign_user'}) { }
720 40 1 unless defined $copyright
741 2 42 if (defined $package_name) { }
743 1 1 if defined $package_version and length $package_version
752 43 1 unless defined $msgid_bugs_address
770 0 0 unless open my $fh, '<', $filename
778 0 0 if ($line =~ /^[\x09-\x0d ]*$/) { }
779 0 0 if (length $chunk)
793 0 0 if (length $chunk)
811 42 0 unless $seen{$canonical}++
819 0 3 unless open my $fh, '<', $potfile
823 0 6 if $file =~ /^[ \x09-\x0d]*#/
825 0 6 unless length $file
828 1 5 if $seen{$canonical}++
908 0 0 unless defined $options{$key}
921 0 7 if ('' eq $option)
927 0 7 if (ref $option) { }
947 0 10 unless my $obj = 'Locale::XGettext::Util::Flag'->newFromString($spec)
956 1 9 if $flags{$function}{$flag}{$arg}
970 0 0 if ($self->needInputFiles) { }
987 0 0 if (defined $self->fileInformation)
1085 0 0 if ($self->canExtractAll)
1091 0 0 if ($self->canKeywords)
1180 0 0 if (defined $url)
1194 0 0 if ($message) { }