Branch Coverage

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


line true false branch
54 3 327 if ($pitch < $$self{'_min_pitch'}) { }
3 324 elsif ($pitch > $$self{'_max_pitch'}) { }
55 1 2 if (exists $$self{'_min_pitch_hook'}) { }
63 1 2 if (exists $$self{'_max_pitch_hook'}) { }
79 56 51 if length $symbol == 0
81 0 51 unless $symbol =~ /^(([,'])\g{-1}*)$/
85 25 26 $2 eq q['] ? :
92 4 1 if (defined $chrome)
93 0 4 unless exists $P2N{$chrome}
114 0 3 unless defined $note
117 3 0 if ($note =~ /^$LY_NOTE_RE/) { }
123 0 3 unless exists $N2P{$real_note}
127 0 3 if $$self{'_ignore_register'}
138 1 1 if defined $state
144 1 2 if defined $state
150 4 1 if (defined $mode)
151 0 4 if $mode ne 'absolute' and $mode ne 'relative'
163 0 11 unless exists $P2N{$$self{'_chrome'}}
175 1 10 if (exists $param{'min_pitch_hook'})
176 0 1 unless ref $param{'min_pitch_hook'} eq 'CODE'
180 1 10 if (exists $param{'max_pitch_hook'})
181 0 1 unless ref $param{'max_pitch_hook'} eq 'CODE'
187 0 11 if $$self{'_mode'} ne 'absolute' and $$self{'_mode'} ne 'relative'
192 0 11 unless ref $$self{'_p2n_hook'} eq 'CODE'
206 0 15 ref $_[0] eq 'ARRAY' ? :
209 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/) { }
211 0 0 unless $$self{'_strip_rests'}
218 2 1 unless $$self{'_strip_rests'}
232 0 137 unless exists $N2P{$real_note}
235 28 109 if ($$self{'_mode'} ne 'relative') { }
247 3 25 if (abs $delta > $TRITONE)
248 2 1 $delta > 0 ? :
253 2 107 if (not defined $$self{'prev_note'}) { }
260 0 2 if (abs $delta > $TRITONE)
261 0 0 $delta > 0 ? :
270 31 76 if (abs $reg_delta > $TRITONE)
271 17 14 $reg_delta > 0 ? :
276 51 56 if ($reg_offset != 0)
284 10 97 if (abs $delta > $TRITONE)
285 5 5 $delta > 0 ? :
289 109 0 if $$self{'_keep_state'}
299 1 13 if ($$self{'_ignore_register'})
301 4 0 if defined $p
305 14 0 unless $$self{'_sticky_state'}
307 10 4 @pitches > 1 ? :
315 0 36 ref $_[0] eq 'ARRAY' ? :
317 0 330 if (not defined $obj) { }
0 330 elsif (blessed $obj and $obj->can('pitch')) { }
330 0 elsif (looks_like_number $obj) { }
338 2 324 if (defined $range_result)
344 0 324 unless defined $note
347 20 304 if ($$self{'_mode'} ne 'relative') { }
352 290 14 if (defined $$self{'prev_pitch'})
354 197 93 if (abs $delta >= $TRITONE)
355 152 45 if ($delta % $DEG_IN_SCALE == $TRITONE) { }
362 36 116 if ($delta > 0 and $default_dir < 0) { }
36 120 elsif ($delta < 0 and $default_dir > 0) { }
370 24 21 $delta > 0 ? :
377 304 0 if $$self{'_keep_state'}
381 316 8 if ($$self{'_keep_state'}) { }
382 0 316 unless defined $register
390 27 5 unless $$self{'_sticky_state'}
391 17 15 @_ > 1 ? :
399 2 0 if (defined $pitch)
400 2 0 if ($pitch =~ /^$LY_NOTE_RE/) { }
406 0 2 unless exists $N2P{$real_note}
422 1 2 if (defined $pitch)
423 0 1 if (blessed $pitch and $pitch->can('pitch')) { }
0 1 elsif (looks_like_number $pitch) { }
440 0 327 unless defined $number and looks_like_number $number
446 77 250 if ($number < $REL_DEF_REG) { }
77 173 elsif ($number > $REL_DEF_REG) { }
457 0 68 unless defined $symbol
458 0 68 unless $symbol =~ /^(,|')*$/
460 7 61 $symbol =~ /[,]/ ? :
467 1 2 if defined $state
473 1 1 if defined $state