Permalink
Browse files

Test more cases.

  • Loading branch information...
1 parent 89cea05 commit adf1c42fee9c01f58f0de0b23fb0f6dde22a9626 @colomon committed May 30, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 t/07-stringify.t
View
@@ -20,12 +20,15 @@ my @simple-cases = ("a", "B,", "c'''", "^D2-", "_E,,/", "^^f/4", "=G3",
"(3abc", "(5A/B/C/D/E/",
"a>b", "^c/4<B,,/4",
'{cdc}', '{/d}',
- "(", ")");
+ "(", ")",
+ " ", "\t ",
+ "[2", "]");
my @tricky-cases = ('"A"', '"A/B"', '"Am/Bb"',
'"^this goes up"', '"_This goes down"',
"+trill+", "+accent+",
- ".", "~");
+ ".", "~",
+ "[K:Amin]", "[M:3/4]", "[L:1/2]");
for @simple-cases -> $test-case {
my $match = ABC::Grammar.parse($test-case, :rule<element>, :actions(ABC::Actions.new));
@@ -43,10 +46,8 @@ sub ElementToStr($element-pair) {
'+' ~ $element-pair.value ~ '+';
}
}
- when "nth_repeat" {}
- when "end_nth_repeat" {}
- when "inline_field" {}
- when "chord_or_text" { '"' ~ $element-pair.value ~ '"' }
+ when "inline_field" { '[' ~ $element-pair.value.key ~ ':' ~ $element-pair.value.value ~ ']'; }
+ when "chord_or_text" { '"' ~ $element-pair.value ~ '"'; }
~$element-pair.value;
}
}

0 comments on commit adf1c42

Please sign in to comment.