Branch Coverage

blib/lib/Passwords.pm
Criterion Covered Total %
branch 21 38 55.2


line true false branch
95 0 4 unless (defined $hash)
100 4 0 if (_is_bcrypt($hash))
103 4 0 if $hash =~ /\A\$2y\$([0-9]{2})\$/x
125 0 1 unless (defined $password)
130 0 1 unless (defined $algo)
135 1 0 if ($algo == 1) { }
138 0 1 if (not exists $options{'cost'} or $options{'cost'} =~ /\D/ or 0 + $options{'cost'} < 4) { }
145 0 1 if (not exists $options{'salt'}) { }
0 1 elsif (not $options{'salt'} =~ /\A[\x00-\xff]{16}\z/) { }
178 0 3 unless (defined $hash)
183 0 3 if (not defined $algo or $algo =~ /\D/)
189 0 3 if ($info{'algo'} != $algo)
193 3 0 if ($info{'algo'} == 1)
195 2 1 if (exists $options{'cost'})
199 2 1 if ($cost != $info{'options'}{'cost'})
216 0 3 if (not defined $password) { }
0 3 elsif (not defined $hash) { }
224 0 3 unless (_is_bcrypt($hash))
244 7 0 if (substr($hash, 0, 4) eq '$2y$' and length $hash == 60)