Permalink
Browse files

Very basic clef information now stored.

  • Loading branch information...
1 parent 5eb61bd commit 4d73dc345913ee84d337e30db36d2b3a9903bb5c @colomon committed Mar 3, 2013
Showing with 10 additions and 1 deletion.
  1. +1 −1 lib/ABC/KeyInfo.pm
  2. +9 −0 t/02-key.t
View
@@ -70,7 +70,7 @@ class ABC::KeyInfo {
}
if $match<clef> {
- say $match<clef>.perl;
+ $clef-info = ~($match<clef>[0]<clef-name> // $match<clef>[0]<clef-note>);
}
self.bless(*, :key(%key-info), :clef($clef-info));
View
@@ -9,6 +9,15 @@ use ABC::KeyInfo;
is $key.key.elems, 2, "D has two sharps";
is $key.key<F>, "^", "F is sharp";
is $key.key<C>, "^", "C is sharp";
+ nok $key.clef.defined, "no clef defined";
+}
+
+{
+ my $key = ABC::KeyInfo.new("D bass");
+ is $key.key.elems, 2, "D has two sharps";
+ is $key.key<F>, "^", "F is sharp";
+ is $key.key<C>, "^", "C is sharp";
+ is $key.clef, "bass", "Recognized bass clef";
}
{

0 comments on commit 4d73dc3

Please sign in to comment.