Branch Coverage

blib/lib/Music/LilyPondUtil.pm
Criterion Covered Total %
branch 122 160 76.2


line true false branch
187 3 327 if ($pitch < $self->{'_min_pitch'}) { }
3 324 elsif ($pitch > $self->{'_max_pitch'}) { }
188 1 2 if (exists $self->{'_min_pitch_hook'}) { }
196 1 2 if (exists $self->{'_max_pitch_hook'}) { }
212 56 51 if length $symbol == 0
214 0 51 unless $symbol =~ /^(([,'])\g{-1}*)$/
218 25 26 $2 eq q['] ? :
225 4 1 if (defined $chrome)
226 0 4 unless exists $P2N{$chrome}
247 0 3 unless defined $note
250 3 0 if ($note =~ /^$LY_NOTE_RE/) { }
256 0 3 unless exists $N2P{$real_note}
259 0 3 if $self->{'_ignore_register'}
270 1 1 if defined $state
276 1 2 if defined $state
282 4 1 if (defined $mode)
283 0 4 if $mode ne 'absolute' and $mode ne 'relative'
296 0 11 unless exists $P2N{$self->{'_chrome'}}
307 1 10 if (exists $param{'min_pitch_hook'})
309 0 1 unless ref $param{'min_pitch_hook'} eq 'CODE'
312 1 10 if (exists $param{'max_pitch_hook'})
314 0 1 unless ref $param{'max_pitch_hook'} eq 'CODE'
320 0 11 if $self->{'_mode'} ne 'absolute' and $self->{'_mode'} ne 'relative'
325 0 11 unless ref $self->{'_p2n_hook'} eq 'CODE'
338 0 15 ref $_[0] eq 'ARRAY' ? :
341 0 144 if (not defined $n) { }
3 141 elsif ($n =~ /^(-?\d+)$/) { }
3 138 elsif ($n =~ /^(?i)[rs]/ or $n =~ /\\rest/) { }
137 1 elsif ($n =~ /^$LY_NOTE_RE/) { }
343 0 0 unless $self->{'_strip_rests'}
350 2 1 unless $self->{'_strip_rests'}
364 0 137 unless exists $N2P{$real_note}
367 28 109 if ($self->{'_mode'} ne 'relative') { }
379 3 25 if (abs $delta > $TRITONE)
380 2 1 $delta > 0 ? :
385 2 107 if (not defined $self->{'prev_note'}) { }
392 0 2 if (abs $delta > $TRITONE)
393 0 0 $delta > 0 ? :
400 31 76 if (abs $reg_delta > $TRITONE)
401 17 14 $reg_delta > 0 ? :
406 51 56 if ($reg_offset != 0)
414 10 97 if (abs $delta > $TRITONE)
415 5 5 $delta > 0 ? :
419 109 0 if $self->{'_keep_state'}
429 1 13 if ($self->{'_ignore_register'})
431 4 0 if defined $p
435 14 0 unless $self->{'_sticky_state'}
437 10 4 @pitches > 1 ? :
445 0 36 ref $_[0] eq 'ARRAY' ? :
447 0 330 if (not defined $obj) { }
0 330 elsif (&blessed($obj) and $obj->can('pitch')) { }
330 0 elsif (&looks_like_number($obj)) { }
468 2 324 if (defined $range_result)
474 0 324 unless defined $note
477 20 304 if ($self->{'_mode'} ne 'relative') { }
482 290 14 if (defined $self->{'prev_pitch'})
484 197 93 if (abs $delta >= $TRITONE)
485 152 45 if ($delta % $DEG_IN_SCALE == $TRITONE) { }
491 36 116 if ($delta > 0 and $default_dir < 0) { }
36 120 elsif ($delta < 0 and $default_dir > 0) { }
499 24 21 $delta > 0 ? :
505 304 0 if $self->{'_keep_state'}
509 316 8 if ($self->{'_keep_state'}) { }
510 0 316 unless defined $register
518 27 5 unless $self->{'_sticky_state'}
519 17 15 @_ > 1 ? :
534 2 0 if (defined $pitch)
535 2 0 if ($pitch =~ /^$LY_NOTE_RE/) { }
541 0 2 unless exists $N2P{$real_note}
556 1 2 if (defined $pitch)
557 0 1 if (&blessed($pitch) and $pitch->can('pitch')) { }
0 1 elsif (&looks_like_number($pitch)) { }
574 0 327 unless defined $number and &looks_like_number($number)
580 77 250 if ($number < $REL_DEF_REG) { }
77 173 elsif ($number > $REL_DEF_REG) { }
591 0 68 unless defined $symbol
592 0 68 unless $symbol =~ /^(,|')*$/
594 7 61 $symbol =~ /[,]/ ? :
601 1 2 if defined $state
607 1 1 if defined $state