Branch Coverage

blib/lib/Net/DAV/LockManager.pm
Criterion Covered Total %
branch 67 68 98.5


line true false branch
30 58 42 unless $lock
31 17 25 unless $token
43 9 51 unless $self->can_modify($req) and not $self->_get_lock($path)
45 3 1 unless _is_permitted($req, $lock)
54 1 47 defined $req->{'timeout'} ? :
6 42 defined $req->{'depth'} ? :
1 47 defined $req->{'scope'} ? :
63 1 4 unless $lock
64 2 2 unless _is_permitted($req, $lock)
76 3 4 unless $lock
77 2 2 unless _is_permitted($req, $lock)
102 4 2 if defined $lock
105 6 10 unless length $path
108 4 12 if $lock and $lock->depth eq 'infinity'
124 282 70 unless $lock
126 0 70 if (time >= $lock->expiry)
172 62 99 unless length $res
175 25 136 if $lock and $lock->depth eq 'infinity'
189 13 24 unless $req->{'user'} eq $lock->creator
190 1 23 unless defined $req->{'token'}
191 7 16 if ('ARRAY' eq ref $req->{'token'}) { }
192 3 4 unless grep {$_ eq $lock->token;} @{$$req{'token'};}
195 5 11 unless $req->{'token'} eq $lock->token
212 8 271 unless 'HASH' eq ref $req
215 15 616 unless exists $req->{$arg}
218 24 232 if $req->{'path'} =~ m[(?:^|/)\.\.?(?:$|/)]
219 13 5 unless $req->{'path'} =~ m[^/] or $req->{'path'} =~ s[^https?://[^/]+/][/]
220 20 199 if (defined $req->{'user'} and not $req->{'user'} =~ /^[0-9a-z_.][-a-z0-9_.]*$/i)
225 2 197 if (defined $req->{'scope'} and $Net::DAV::Lock::DEFAULT_SCOPE ne $req->{'scope'})
229 2 12 if (defined $req->{'depth'} and '0' ne $req->{'depth'} and 'infinity' ne $req->{'depth'})
233 3 192 if (defined $req->{'timeout'} and $req->{'timeout'} =~ /\D/)
237 53 139 if (defined $req->{'token'})
238 1 52 unless (not ref $req->{'token'} or 'ARRAY' eq ref $req->{'token'})
244 169 22 unless $req->{'path'} eq '/'