Branch Coverage

blib/lib/Bitcoin/Crypto/Bech32.pm
Criterion Covered Total %
branch 36 38 94.7


line true false branch
48 14186 18329 $b >> $_ & 1 ? :
111 1 71 unless &Str()->check($bech32enc)
115 12 59 if uc $bech32enc eq $bech32enc
118 2 69 if length $bech32enc > 90
122 2 67 if lc $bech32enc ne $bech32enc
128 1 66 if @parts < 2
136 3 63 if length $parts[0] < 1 or length $parts[0] > 83
140 3 60 unless $parts[0] =~ /^[\x21-\x7e]+$/
144 1 59 if length $parts[1] < 6
149 3 56 unless $parts[1] =~ /^[$chars]+$/
169 3 16 if length($bits) % 8 != 0 or length $bits < $length_padded - 4
204 0 1414 if $num < 0 or $num > 31
230 29 12 if ($type eq 'bech32') { }
12 0 elsif ($type eq 'bech32m') { }
250 20 5 $version == 0 ? :
258 26 30 if verify_checksum($hrp, $data)
260 25 31 if not $type and verify_checksum_bech32m($hrp, $data)
263 5 51 unless $type
275 6 19 if $ver == 0 and $type ne "bech32" or $ver > 0 and $type ne "bech32m"