Skip to content
Browse files

Second test for broken_rhythm.

  • Loading branch information...
1 parent 1b40656 commit 46f07930f447ac02c3e09c97f21ce4010b031043 @LastOfTheCarelessMen committed
Showing with 15 additions and 1 deletion.
  1. +15 −1 t/01-regexes.t
View
16 t/01-regexes.t
@@ -109,7 +109,6 @@ plan *;
{
my $match = "A>^C'" ~~ m/ <ABC::broken_rhythm> /;
isa_ok $match, Match, '"A>^C" is a broken rhythm';
- say $match.perl;
is $match<ABC::broken_rhythm><note>[0]<pitch><basenote>, "A", 'first note is A';
is $match<ABC::broken_rhythm><note>[0]<pitch><octave>, "", 'first note has no octave';
is $match<ABC::broken_rhythm><note>[0]<pitch><accidental>, "", 'first note has no accidental';
@@ -121,5 +120,20 @@ plan *;
is $match<ABC::broken_rhythm><note>[1]<note_length>, "", 'second note has no length';
}
+{
+ my $match = "d'<<<+accent+_B" ~~ m/ <ABC::broken_rhythm> /;
+ isa_ok $match, Match, '"d<<<+accent+_B" is a broken rhythm';
+ is $match<ABC::broken_rhythm><note>[0]<pitch><basenote>, "d", 'first note is d';
+ is $match<ABC::broken_rhythm><note>[0]<pitch><octave>, "'", 'first note has an octave tick';
+ is $match<ABC::broken_rhythm><note>[0]<pitch><accidental>, "", 'first note has no accidental';
+ is $match<ABC::broken_rhythm><note>[0]<note_length>, "", 'first note has no length';
+ is $match<ABC::broken_rhythm><broken_rhythm_bracket>, "<<<", 'angle is <<<';
+ # how to know first gracing pattern versus second?
+ is $match<ABC::broken_rhythm><gracing>[0], "+accent+", 'second gracing is +accent+';
+ is $match<ABC::broken_rhythm><note>[1]<pitch><basenote>, "B", 'second note is B';
+ is $match<ABC::broken_rhythm><note>[1]<pitch><octave>, "", 'second note has no octave';
+ is $match<ABC::broken_rhythm><note>[1]<pitch><accidental>, "_", 'second note is flat';
+ is $match<ABC::broken_rhythm><note>[1]<note_length>, "", 'second note has no length';
+}
done_testing;

0 comments on commit 46f0793

Please sign in to comment.
Something went wrong with that request. Please try again.