Permalink
Browse files

All tests now pass on both Rakuod and Niecza.

  • Loading branch information...
colomon committed Apr 19, 2012
1 parent acf9f41 commit 9bffd79c0214ea556115153a69b5679bf1d8eae6
Showing with 6 additions and 7 deletions.
  1. +2 −2 lib/ABC/Actions.pm
  2. +4 −2 lib/ABC/Duration.pm
  3. +0 −1 t/01-regexes.t
  4. +0 −2 t/06-duration.t
View
@@ -25,9 +25,9 @@ class ABC::Actions {
method note_length($/) {
if $<note_length_denominator> {
- make duration-from-parse($<top>[0], $<note_length_denominator>[0]<bottom>[0]);
+ make duration-from-parse($<top>, $<note_length_denominator>[0]<bottom>);
} else {
- make duration-from-parse($<top>[0]);
+ make duration-from-parse($<top>);
}
}
View
@@ -4,11 +4,13 @@ role ABC::Duration {
has $.ticks;
multi sub duration-from-parse($top) is export {
- ABC::Duration.new(:ticks(($top // 1).Int));
+ ABC::Duration.new(:ticks(($top ?? +~$top !! 1).Int));
}
multi sub duration-from-parse($top, $bottom) is export {
- ABC::Duration.new(:ticks(($top // 1).Int / ($bottom // 2).Int));
+ # $*ERR.say: :$top.perl;
+ # $*ERR.say: :$bottom.perl;
+ ABC::Duration.new(:ticks(($top ?? +~$top !! 1).Int / ($bottom ?? +~$bottom !! 2).Int));
}
our method duration-to-str() {
View
@@ -112,7 +112,6 @@ use ABC::Grammar;
my $match = ABC::Grammar.parse("+trill+", :rule<element>);
isa_ok $match, Match, 'Got a match';
ok $match, '"+trill+" is an element';
- $*ERR.say: $match<gracing>;
is $match<gracing>, "+trill+", '"+trill+" gracing is +trill+';
}
View
@@ -2,8 +2,6 @@ use v6;
use Test;
use ABC::Duration;
-plan *;
-
is duration-from-parse("2", "3").ticks.perl, (2/3).perl, "2/3 works properly";
ok duration-from-parse("2", "3") ~~ ABC::Duration, "2/3 generates an object which does Duration";
is duration-from-parse(Any, Any).ticks.perl, (1/2).perl, "/ works properly";

0 comments on commit 9bffd79

Please sign in to comment.