Branch Coverage

blib/lib/Locale/Utils/Autotranslator.pm
Criterion Covered Total %
branch 90 116 77.5


line true false branch
200 6 0 unless $1
274 0 2 if exists $self->_plural_ref->{'0'}
281 0 4 if ($plural > $nplurals - 1)
289 4 0 unless (exists $self->_plural_ref->{$plural})
292 2 2 if $nplurals == keys %{$self->_plural_ref;}
303 0 5 unless defined $name_read
305 0 5 unless defined $name_write
307 0 5 unless my $pos_ref = 'Locale::PO'->load_file_asarray($name_read)
342 0 13 if length $entry_ref->{'msgstr'}
356 0 13 if $is_all_translated
357 2 11 if (length $entry_ref->{'msgid_plural'}) { }
2 9 elsif ($entry_ref->{'msgid'} =~ / \{ [^\{\}]+ \} /msx) { }
7 2 elsif ($entry_ref->{'msgid'} =~ / [%] (?: \d | [*] | quant ) /msx) { }
358 2 0 if ($nplurals)
376 2 0 if ($self->translation_count)
381 1 2 if ($self->translation_count)
393 0 3 unless / \A API\ error\:\ | \A Byte\ limit\ exceeded\,\ | \A (?: Before | After ) (?: \ paragraph | \ line )? \ translation\ break \b /msx
403 2 4 defined $num ? :
408 6 6 if ($is_num)
424 12 0 unless $1
436 3 3 exists $self->_num_ref->{$1} ? :
462 0 4 if defined $entry_ref->{'msgstr_n'}{$index} and length $entry_ref->{'msgstr_n'}{$index}
466 2 2 $index ? :
484 10 2 defined $_ && length $_ ? :
510 6 12 $2 ? :
0 18 $1 ? :
525 3 3 if ($inner =~ / \A ( \d+ ) \z /msx)
528 3 0 if ($inner =~ / \A ( [*] | quant ) [,] ( \d+ ) [,] ( .* ) \z /msx)
582 5 5 unless defined $self->comment
584 0 5 unless length $self->comment
586 4 1 unless (defined $po->comment)
603 0 6 unless ref $callback eq 'CODE'
605 0 6 unless defined $msgid
615 12 1 length $_ ? :
623 1 4 if $has_network_line_endings
632 0 6 unless ref $callback eq 'CODE'
634 0 6 unless defined $msgid
645 14 1 length $_ ? :
647 1 5 $has_network_line_endings ? :
659 48 19 unless $self->bytes_max
664 9 10 $msgid_bytes > $self->bytes_max ? :
679 1 7 if $fail_message
682 0 7 unless defined $msgstr
686 0 7 unless length $msgstr
691 4 27 $self->_bytes_max_fail_message($msgid) ? :
693 1 25 unless defined $msgstr
697 1 25 unless length $msgstr
706 0 0 $is_called_indirectly ? :
0 29 if $self->error
710 23 6 if ($self->before_translation_code)
711 1 22 unless $self->before_translation_code->($self, $msgid)
719 4 24 $fail_message ? :
722 1 2 if (/ \A No\ translation\ break \b /msx) { }
1 1 elsif (/ \A Byte\ limit\ exceeded\,\ /msx) { }
734 1 1 $is_called_indirectly ? :
2 26 if $self->error
739 23 3 if ($self->after_translation_code)
740 1 22 unless $self->after_translation_code->($self, $msgid, $msgstr)