Branch Coverage

blib/lib/Authen/Htpasswd.pm
Criterion Covered Total %
branch 35 72 48.6


line true false branch
83 0 2 ref $_[-1] eq 'HASH' ? :
84 2 0 if $_[0]
85 0 2 unless $$self{'file'}
86 0 2 unless (-e $$self{'file'})
87 0 0 unless open my $file, '>', $$self{'file'}
88 0 0 unless close $file
93 2 0 unless (defined $$self{'write_locking'})
94 0 2 if ($^O eq 'MSWin32' or $^O eq 'cygwin') { }
115 0 18 unless my $file = 'IO::LockedFile'->new($self->file, 'r')
119 16 31 if ($username eq $search_username)
120 0 16 unless $file->close
129 0 2 unless $file->close
143 0 1 unless my $file = 'IO::LockedFile'->new($self->file, 'r')
154 0 1 unless $file->close
170 1 12 unless $user
192 4 12 if ($line =~ /^\Q$username\E:/) { }
195 2 2 if scalar @extra_info
202 0 4 unless $seen
223 0 4 if ($line =~ /^\Q$username\E:/)
244 0 2 blessed($_[0]) && $_[0]->isa('Authen::Htpasswd::User') ? :
248 2 7 if $line =~ /^\Q$username\E:/
256 28 0 if ($$self{'write_locking'}) { }
265 3 2 if blessed($_[0]) and $_[0]->isa('Authen::Htpasswd::User')
266 0 2 ref $_[-1] eq 'HASH' ? :
274 7 0 if ($$self{'write_locking'}) { }
275 0 7 unless my $old = 'IO::LockedFile'->new($self->file, 'r+')
276 0 7 unless my $new = 'IO::File'->new($self->file . $Authen::Htpasswd::SUFFIX, 'w')
279 0 0 unless my $old = 'IO::File'->new($self->file, 'r')
287 7 0 if ($$self{'write_locking'}) { }
288 0 7 unless $new->close
289 0 7 unless rename $self->file . $Authen::Htpasswd::SUFFIX, $self->file
290 0 7 unless $old->close
292 0 0 unless $old->close
293 0 0 unless $old = 'IO::File'->new($self->file, 'w')
295 0 0 unless $old->close
301 0 0 if ($$self{'write_locking'}) { }