Branch Coverage

blib/lib/Crypt/Misc.pm
Criterion Covered Total %
branch 68 88 77.2


line true false branch
42 1 291 unless defined $bytes
43 1 290 if length $bytes == 0
47 80 210 if ($bytes =~ /^(\x00+)/)
52 290 0 if (defined $alphabet)
54 0 290 unless $alphabet =~ /^[a-zA-Z0-9]{58}$/
66 1 293 unless defined $base58
67 1 292 if length $base58 == 0
70 292 0 if (defined $alphabet)
71 2 290 unless $alphabet =~ /^[a-zA-Z0-9]{58}$/ and $base58 =~ /^[$alphabet]+$/
76 0 290 unless $base58 =~ /^[$default]+$/
80 80 210 if ($base58 =~ /^(0+)(.*)$/)
84 265 25 if defined $base58 and length $base58 > 0
108 4 24 unless defined $content
109 0 28 unless $content
110 2 26 if not defined $obj1 && defined $obj2 or $obj1 ne $obj2
119 0 26 unless $b64
122 0 26 unless defined $binary
127 10 10 if $k eq "Proc-Type"
128 10 10 if $k eq "DEK-Info"
130 10 0 if ($cipher_name and $iv_hex and $ptype and $ptype eq "4,ENCRYPTED")
131 0 10 unless defined $password
142 4 33 unless defined $header_name and $header_name =~ /^[0-9A-Za-z ]+$/
146 9 24 if (defined $password)
156 9 24 if (@headers)
169 0 297 unless -f $f
170 0 297 unless open my $fh, "<", $f
177 0 3 unless defined $_[1]
178 0 3 unless open my $fh, ">", $_[0]
180 0 3 unless print $fh $_[1]
181 0 3 unless close $fh
221 0 5 unless $uuid
222 2 3 if $uuid =~ /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i
228 1 10 unless $uuid
229 6 4 if $uuid =~ /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i
240 1 19 unless $cipher and $mode
242 2 17 if $cipher eq "DES_EDE"
243 2 17 if $cipher eq "DES"
244 2 17 if $cipher eq "SEED"
245 19 0 $klen ? :
247 0 19 unless $klen and $ilen
249 15 4 if $mode eq "CBC"
250 2 2 if $mode eq "CFB"
251 0 2 if $mode eq "ECB"
252 2 0 if $mode eq "OFB"