Branch Coverage

blib/lib/Locale/MakePhrase/BackingStore/Directory.pm
Criterion Covered Total %
branch 64 126 50.7


line true false branch
118 1 0 if (@_ > 1 and not @_ % 2) { }
0 0 elsif (@_ == 1 and ref $_[0] eq 'HASH') { }
0 0 elsif (@_ == 1) { }
125 0 1 if $DEBUG > 5
129 0 1 unless $self
131 1 0 exists $options{'directory'} ? :
132 0 1 exists $$self{'extension'} ? :
0 1 exists $options{'extension'} ? :
133 0 1 exists $$self{'encoding'} ? :
0 1 exists $options{'encoding'} ? :
134 0 0 $options{'reload'} ? :
0 0 $$self{'reload'} ? :
0 1 exists $$self{'reload'} ? :
0 1 exists $options{'reload'} ? :
139 0 1 unless defined $$self{'directory'}
140 0 1 unless -d $$self{'directory'}
141 0 1 unless $$self{'encoding'}
142 0 1 unless defined $$self{'extension'}
145 0 1 if (length $$self{'extension'} and substr($$self{'extension'}, 0, 1) ne '.')
171 3 0 if $$self{'reload'}
177 3 3 unless exists $$rules{$language}
180 0 3 unless @langs
184 0 3 if ($context) { }
189 0 0 unless $keys or ref $keys ne 'HASH'
191 0 0 unless $keys
202 0 3 unless $keys
211 0 3 if $DEBUG
230 0 1 unless -r $dir
231 0 1 unless opendir DIR, $dir
235 2 2 unless $language =~ /$ext$/
236 0 2 unless -f "$dir/$language" || -l "$dir/$language" and -r "$dir/$language"
238 2 0 unless I18N::LangTags::is_language_tag($language)
257 2 4 if (exists $$loaded_languages{$language})
260 2 0 if $$loaded_languages{$language}{'mtime'} == $mtime
276 0 4 if (exists $$self{'loaded_languages'}{$language})
279 4 0 unless (defined $file)
281 3 1 unless defined $file
288 1 0 unless $rules
294 0 1 unless open $fh, "<:encoding($encoding)", "$file"
301 4 8 if not defined $_ or length $_ == 0 or /^#/
309 0 8 unless $1
314 3 5 if ($lhs eq 'key') { }
1 4 elsif ($lhs eq 'expression' and not defined $expression) { }
1 3 elsif ($lhs eq 'priority' and not defined $priority) { }
3 0 elsif ($lhs eq 'translation' and not defined $translation) { }
0 0 elsif ($lhs eq 'context' and not defined $context) { }
315 0 3 if $in_group
318 0 3 unless length $key
328 0 3 unless length $translation
337 2 3 unless defined $translation
338 2 1 unless $expression
339 2 1 unless $priority
340 3 0 unless $context
345 0 3 if ($context) { }
347 0 0 unless ($entries)
348 0 0 unless $entries
353 2 1 unless ($entries)
354 2 0 unless $entries
380 1 3 if (-f $path || -l $path and -r $path)
381 0 1 if $DEBUG > 2
394 0 0 if ($$s_ref =~ m[/$])
400 0 0 if (/\.\s*\\$/) { }
406 0 0 unless $$s_ref =~ m[/$]