Branch Coverage

blib/lib/MP3/Tag/ID3v1.pm
Criterion Covered Total %
branch 71 106 66.9


line true false branch
112 0 153 unless $attr =~ /[^A-Z]/
113 2 151 if $attr eq "song"
114 0 153 unless $MP3::Tag::ID3v1::ok_length{$attr}
116 79 74 if (@_)
119 17 62 if ($attr eq "genre")
120 9 8 if ($new =~ /^\d+$/) { }
126 11 6 if defined $self->{'genreID'} and $self->{'genreID'} < @MP3::Tag::ID3v1::winamp_genres
153 1 0 if ($#_ == 6)
161 0 1 if ($self->{'genre'} =~ /^\d+$/) { }
167 1 0 if defined $self->{'genreID'} and $self->{'genreID'} < @MP3::Tag::ID3v1::winamp_genres
173 1 0 if (wantarray)
193 15 20 if (defined(my $track = $hash->{'track'}))
194 14 1 if ref $track
195 2 13 unless $track =~ /^\d{0,3}$/ and $track eq '' || $track < 256
199 110 43 unless defined(my $data = $hash->{$elt})
200 39 4 if ref $data
201 0 43 if $data =~ /[^\x00-\xFF]/
203 40 3 if $MP3::Tag::ID3v1::ok_length{$elt} >= length $data
205 0 0 if $elt eq "comment" and not $hash->{'track'} and length $data <= 30
208 16 14 if (defined(my $genre = $hash->{'genre'}))
209 0 16 if ref $genre
211 2 14 if @g > 1
213 0 10 if not defined $id or $id eq "" or $id == 255
215 0 24 if ($s =~ /[^\x00-\x7E]/)
220 0 0 if $r eq $w and $w eq "iso-8859-1"
221 0 0 if $w eq "iso-8859-1"
223 0 0 if $w ne $r and not +($self->get_config('encoded_v1_fits') || [0])->[0]
253 0 0 if ($e = $self->get_config("encode_encoding_v1") and $e->[0])
262 4 29 if $t
263 0 33 unless $self->{'genreID'} =~ /^\d+$/
271 0 33 unless exists $self->{'title'} and exists $self->{'changed'}
276 33 0 if ($mp3obj->open('write')) { }
279 19 14 if ($mp3tag eq 'TAG') { }
319 0 0 if ($mp3tag eq "TAG")
321 0 0 if ($mp3obj->open("write"))
351 75 0 if (defined $self and not defined $genre and not $self =~ /MP3::Tag/)
357 6 75 unless defined $genre
359 61 14 if ($genre =~ /^\d+$/)
360 39 22 if $genre < scalar @MP3::Tag::ID3v1::winamp_genres
366 2 1899 if (uc $_ eq uc $genre)
372 12 2 unless $found
407 16 85 if ($create) { }
410 85 0 unless $fileobj->is_open
413 36 49 unless substr($buffer, 0, 3) eq "TAG"
423 36 49 unless my $new = $class->new($filename, undef)
437 16 49 if ($self->{'new'}) { }
443 49 0 $] < 5.6 ? :
449 0 49 if ($id3v1 != 0)
452 0 0 if $self->{'track'} and $self->{'track'} != 32
455 43 6 unless $self->{'track'}
457 0 0 if ($e = $self->get_config("decode_encoding_v1") and $e->[0])
471 28 33 unless defined $id and $id < @MP3::Tag::ID3v1::winamp_genres
478 6 3 if defined $genre