Permalink
Browse files

Unfudge now-passing TODO tests after more Rat.perl changes.

  • Loading branch information...
1 parent bf130cd commit 3f509809f5980fe012f9c5bbdf5aee50f6f46726 @pmichaud pmichaud committed Mar 6, 2013
Showing with 2 additions and 9 deletions.
  1. +0 −4 S03-sequence/basic.t
  2. +1 −0 S32-num/rat.t
  3. +1 −5 integration/advent2009-day14.t
@@ -23,7 +23,6 @@ is (1, { $_ + 2 } ... 9).join(', '), '1, 3, 5, 7, 9', 'simple sequence with one
is (1, *+2 ... 9).join(', '), '1, 3, 5, 7, 9', 'simple sequence with one item and * closure on the LHS';
is (1, { $_ - 2 } ... -7).join(', '), '1, -1, -3, -5, -7', 'simple sequence with one item and closure on the LHS';
is (1, 3, 5, { $_ + 2 } ... 13).join(', '), '1, 3, 5, 7, 9, 11, 13', 'simple sequence with three items and block closure on the LHS';
-#?rakudo todo "New Rat.perl"
is (1, { 1 / ((1 / $_) + 1) } ... 1/5).map({.perl}).join(', '), '1, 0.5, <1/3>, 0.25, 0.2', 'tricky sequence with one item and closure on the LHS';
is (1, { -$_ } ... 1).join(', '), '1', 'simple alternating sequence with one item and closure on the LHS';
is (1, { -$_ } ... 3).[^5].join(', '), '1, -1, 1, -1, 1', 'simple alternating sequence with one item and closure on the LHS';
@@ -47,7 +46,6 @@ is (1, { $_ + 2 } ... 10).[^6].join(', '), '1, 3, 5, 7, 9, 11', 'simple sequence
is (1, *+2 ... 10).[^6].join(', '), '1, 3, 5, 7, 9, 11', 'simple sequence with one item and * closure on the LHS';
is (1, { $_ - 2 } ... -8).[^6].join(', '), '1, -1, -3, -5, -7, -9', 'simple sequence with one item and closure on the LHS';
is (1, 3, 5, { $_ + 2 } ... 14).[^8].join(', '), '1, 3, 5, 7, 9, 11, 13, 15', 'simple sequence with three items and block closure on the LHS';
-#?rakudo todo "New Rat.perl"
is (1, { 1 / ((1 / $_) + 1) } ... 11/60).[^6].map({.perl}).join(', '), '1, 0.5, <1/3>, 0.25, 0.2, <1/6>', 'tricky sequence with one item and closure on the LHS';
is (1, { -$_ } ... 0).[^4].join(', '), '1, -1, 1, -1', 'simple alternating sequence with one item and closure on the LHS';
@@ -68,7 +66,6 @@ is (1, { $_ + 2 } ... *).[^5].join(', '), '1, 3, 5, 7, 9', 'simple sequence with
is (1, *+2 ... *).[^5].join(', '), '1, 3, 5, 7, 9', 'simple sequence with one item and * closure on the LHS';
is (1, { $_ - 2 } ... *).[^5].join(', '), '1, -1, -3, -5, -7', 'simple sequence with one item and closure on the LHS';
is (1, 3, 5, { $_ + 2 } ... *).[^7].join(', '), '1, 3, 5, 7, 9, 11, 13', 'simple sequence with three items and block closure on the LHS';
-#?rakudo todo "New Rat.perl"
is (1, { 1 / ((1 / $_) + 1) } ... *).[^5].map({.perl}).join(', '), '1, 0.5, <1/3>, 0.25, 0.2', 'tricky sequence with one item and closure on the LHS';
is (1, { -$_ } ... *).[^5].join(', '), '1, -1, 1, -1, 1', 'simple alternating sequence with one item and closure on the LHS';
@@ -102,7 +99,6 @@ is (False, { !$_ } ... *).[^10].grep(Bool).elems, 10, "alternating False and Tru
# L<S03/List infix precedence/'"asymptotically approaching" is not the same as "equals"'>
# infinite sequence with limits
-#?rakudo 3 todo "New Rat.perl"
is ~(1, 1/2, 1/4 ... 0).[^5].map({.perl}), '1 0.5 0.25 0.125 0.0625', 'geometric sequence that never reaches its limit';
is ~(1, -1/2, 1/4 ... 0).[^5].map({.perl}), '1 -0.5 0.25 -0.125 0.0625', 'alternating geometric sequence that never reaches its limit';
is (1, { 1 / ((1 / $_) + 1) } ... 0).[^5].map({.perl}).join(', '), '1, 0.5, <1/3>, 0.25, 0.2', '"harmonic" sequence that never reaches its limit';
View
@@ -19,6 +19,7 @@ isa_ok( Rat.new, Rat, 'Rat.new is Rat' );
#?pugs todo
isa_ok( eval(Rat.new.perl), Rat, 'eval Rat.new.perl is Rat' );
#?pugs 2 skip 'Must only use named arguments to new() constructor'
+#?rakudo 4 todo '<1/3> literal should be Rat'
isa_ok( eval(Rat.new(1, 3).perl), Rat, 'eval Rat.new(1, 3).perl is Rat' );
is( (eval Rat.new(1, 3).perl), 1/3, 'eval Rat.new(1, 3).perl is 1/3' );
isa_ok( eval((1/3).perl), Rat, 'eval (1/3).perl is Rat' );
@@ -11,7 +11,6 @@ is_approx (3/7), 0.4285714;
is_approx (3/7).Num + (2/7).Num + (2/7).Num - 1, -1.1102230e-16;
is 3/7 + 2/7 + 2/7 - 1, 0;
-#?rakudo todo "New Rat.perl"
#?pugs todo "<>"
is (3/7).perl, "<3/7>";
@@ -23,7 +22,6 @@ is (3/7).nude.join('|'), "3|7";
my $a = 1/60000 + 1/60000;
is $a.WHAT, Rat;
is_approx $a, 3.3333333e-05;
-#?rakudo todo "New Rat.perl"
#?pugs todo "<>"
is $a.perl, "<1/30000>";
@@ -35,12 +33,10 @@ $a = cos(1/60000);
ok $a ~~Num, 'cos() returned a Num';
is_approx $a, 0.99999999;
-#?rakudo 2 todo "New Rat.perl"
#?pugs todo "<>"
-is 3.14.Rat.perl, "<157/50>";
+is 3.14.Rat.perl, "3.14";
#?pugs todo "<>"
is pi.Rat.perl, "<355/113>";
-#?rakudo todo 'nom regression'
#?pugs todo "<>"
is pi.Rat(1e-10).perl, "<312689/99532>";

0 comments on commit 3f50980

Please sign in to comment.