Permalink
Browse files

[S32] remove more tests for now-gone calling-positionals-by-named tests

  • Loading branch information...
moritz committed May 23, 2011
1 parent 87efb8a commit c5fa27b821e9bba2c8845c7e285d690b5760a6c8
Showing with 12 additions and 80 deletions.
  1. +1 −3 S32-hash/keys_values.t
  2. +0 −1 S32-io/path.t
  3. +1 −2 S32-list/end.t
  4. +1 −7 S32-list/first.t
  5. +1 −12 S32-list/grep.t
  6. +1 −4 S32-list/join.t
  7. +1 −8 S32-list/map.t
  8. +1 −7 S32-list/minmax.t
  9. +1 −3 S32-list/pick.t
  10. +1 −6 S32-list/reverse.t
  11. +1 −3 S32-list/roll.t
  12. +1 −5 S32-num/abs.t
  13. +1 −19 S32-num/exp.t
View
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 16;
+plan 14;
=begin pod
@@ -15,13 +15,11 @@ my %hash = (a => 1, b => 2, c => 3, d => 4);
# L<S32::Containers/"Hash"/=item keys>
is(~%hash.keys.sort, "a b c d", '%hash.keys works');
is(~sort(keys(%hash)), "a b c d", 'keys(%hash) on hashes');
-is(~sort(keys(:array(%hash))), 'a b c d', 'keys(:array(%hash)) works with named args');
is(+%hash.keys, +%hash, 'we have the same number of keys as elements in the hash');
# L<S32::Containers/"Hash"/=item values>
is(~%hash.values.sort, "1 2 3 4", '%hash.values works');
is(~sort(values(%hash)), "1 2 3 4", 'values(%hash) works');
-is(~sort(values(:array(%hash))), '1 2 3 4', 'values(:array(%hash)) works with named args');
is(+%hash.values, +%hash, 'we have the same number of keys as elements in the hash');
# keys and values on Pairs
View
@@ -3,7 +3,6 @@ use Test;
plan 4;
-#?rakudo: 4 eval "Rakudo doesn't parse Path literals yet."
isa_ok qp{foo}, Path, 'qp{foo} creates a Path object.';
isa_ok qp{/foo}, Path, 'qp{/foo} creates a Path object.';
isa_ok qp{foo/bar}, Path, 'qp{foo/bar} creates a Path object.';
View
@@ -9,7 +9,7 @@ use Test;
Array .end tests
=end docs
-plan 15;
+plan 14;
# basic array .end tests
@@ -41,7 +41,6 @@ plan 15;
is(end(@array), 42, 'index of last element is 42 after assignment');
@array.pop;
- is(end(:array(@array)), 41, 'index of last element is 41 after pop');
is((end @array), 41, 'index of last element is 41 after pop');
shift @array;
View
@@ -3,7 +3,7 @@ use Test;
# L<S32::Containers/"List"/"=item first">
-plan 23;
+plan 21;
my @list = (1 ... 10);
@@ -19,12 +19,6 @@ my @list = (1 ... 10);
is($result, 1, "returned value by first() is correct");
}
-#?rakudo skip 'RT 74344'
-{
- my $result = first({ ($^a % 2) }, :values(@list));
- ok($result ~~ Int, "first() returns an Int");
- is($result, 1, "returned value by first() is correct");
-}
{
my $result = @list.first( { ($^a == 4)});
View
@@ -9,7 +9,7 @@ built-in grep tests
=end pod
-plan 44;
+plan 38;
my @list = (1 .. 10);
@@ -23,17 +23,6 @@ my @list = (1 .. 10);
is(@result[4], 9, 'got the value we expected');
}
-#?rakudo skip 'calling a slurpy by name, RT 74344'
-{
- my @result = grep({ ($_ % 2) }, :values(@list));
- is(+@result, 5, 'we got a list back');
- is(@result[0], 1, 'got the value we expected');
- is(@result[1], 3, 'got the value we expected');
- is(@result[2], 5, 'got the value we expected');
- is(@result[3], 7, 'got the value we expected');
- is(@result[4], 9, 'got the value we expected');
-}
-
#?rakudo skip "adverbial block"
{
my @result = @list.grep():{ ($_ % 2) };
View
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 35;
+plan 34;
# L<S32::Containers/"List"/"=item join">
@@ -15,9 +15,6 @@ my @list = ("a", "b", "c");
is(@list.join("|"), "a|b|c", '@list.join("|") works');
-#?rakudo skip 'calling positional params by name'
-is(join("|", :values(@list)), "a|b|c", 'join("|", :values(@list)) works');
-
my $joined2 = join("|", @list);
is($joined2, "a|b|c", 'join("|", @list) works');
View
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 54;
+plan 52;
# L<S32::Containers/"List"/"=item map">
@@ -13,13 +13,6 @@ plan 54;
my @list = (1 .. 5);
-#?rakudo skip "Named value argument NYI"
-{
- my @result = map( { $_ * 2 }, :values(@list) );
- is(+@result, 5, 'named :values: we got a list back');
- is @result.join(', '), '2, 4, 6, 8, 10', 'got the values we expected';
-}
-
{
my @result = map { $_ * 2 }, @list;
is(+@result, 5, 'sub form: we got a list back');
View
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 54;
+plan 51;
# L<S32::Containers/List/=item min>
# L<S32::Containers/List/=item max>
@@ -19,8 +19,6 @@ my @array = (5,-3,7,0,1,-9); #NOTICE! The <> don't work like they should, rakudo
# Tests for C<min>:
is @array.min, -9, "basic method form of min works";
is min(@array), -9, 'min(list)';
-#?rakudo skip 'named args'
-is min(:by({$^a <=> $^b }), :values(@array)), -9, "basic subroutine form of min works with named args";
is (@array.min: { $^a <=> $^b }), -9,
"method form of min with identity comparison block works";
@@ -48,8 +46,6 @@ is ((1..10).min: { ($_-3) * ($_-5) }), 4,
# Tests for C<max>:
is (@array.max), 7, "basic method form of max works";
is max(:by({ $^a <=> $^b }), @array), 7, "basic subroutine form of max works";
-#?rakudo skip 'named args'
-is max(:values(@array)), 7, "basic subroutine form of max works with named args";
is (@array.max: { $^a <=> $^b }), 7,
"method form of max with identity comparison block works";
@@ -79,8 +75,6 @@ is ((1..10).max: { ($_-3) * ($_-5) }), 10,
# Tests for C<minmax>:
is @array.minmax, -9..7, "basic method form of minmax works";
is minmax(@array), -9..7, 'minmax(list)';
-#?rakudo skip 'named args'
-is minmax(:by({$^a <=> $^b }), :values(@array)), -9..7, "basic subroutine form of minmax works with named args";
is (@array.minmax: { $^a <=> $^b }), -9..7,
"method form of minmax with identity comparison block works";
View
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 28;
+plan 27;
=begin description
@@ -31,8 +31,6 @@ ok ~(@arr.pick(4)) eq 'z z z', 'method pick with $num > +@values';
#?pugs 2 todo 'feature'
is pick(2, @arr), <z z>, 'sub pick with $num < +@values, implicit no-replace';
is pick(4, @arr), <z z z>, 'sub pick with $num > +@values';
-#?rakudo skip "Calling values by name fails hard"
-is pick(2, :values(@arr)), <z z>, 'sub pick with $num < +@values and named args';
is (<a b c d>.pick(*).sort).Str, 'a b c d', 'pick(*) returns all the items in the array (but maybe not in order)';
View
@@ -3,7 +3,7 @@ use Test;
# L<S32::Containers/List/"=item reverse">
-plan 22;
+plan 21;
@@ -19,11 +19,6 @@ my @a = reverse(1, 2, 3, 4);
my @e = (4, 3, 2, 1);
is(@a, @e, "list was reversed");
-#?rakudo skip 'named args'
-{
- @a = reverse(:values(1, 2, 3, 4));
- is(@a, @e, "list was reversed");
-}
{
my $a = reverse("foo");
View
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 24;
+plan 23;
=begin description
@@ -27,8 +27,6 @@ ok ~(@arr.roll(4)) eq 'z z z z', 'method roll with $num > +@values';
#?pugs 2 todo 'feature'
is roll(2, @arr), <z z>, 'sub roll with $num < +@values, implicit no-replace';
is roll(4, @arr), <z z z z>, 'sub roll with $num > +@values';
-#?rakudo skip "Calling values by name fails hard"
-is roll(2, :values(@arr)), <z z>, 'sub roll with $num < +@values and named args';
is <a b c d>.roll(*)[^10].elems, 10, 'roll(*) generates at least ten elements';
View
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 50;
+plan 48;
# L<S32::Numeric/Numeric/"=item abs">
@@ -17,8 +17,6 @@ Basic tests for the abs() builtin
for 0, 0 / 1, 0.0e0, 1, 50, 60.0e0, 99.99 {
is(abs($_), $_, "got the right absolute value for $_");
is(.abs, $_, 'got the right absolute value for $_='~$_);
- #?rakudo skip 'named args'
- is(abs(:x($_)), $_, "got the right absolute value for $_");
unless $_ ~~ Int {
ok(abs($_) ~~ $_.WHAT, "got the right data type (" ~ $_.WHAT ~ ") of absolute value for $_");
@@ -29,8 +27,6 @@ for 0, 0 / 1, 0.0e0, 1, 50, 60.0e0, 99.99 {
for -1, -50, -60.0e0, -9999 / 100 {
is(abs($_), -$_, "got the right absolute value for $_");
is(.abs, -$_, 'got the right absolute value for $_='~$_);
- #?rakudo skip 'named args'
- is(abs(:x($_)), -$_, "got the right absolute value for $_");
unless $_ ~~ Int {
ok(abs($_) ~~ $_.WHAT, "got the right data type (" ~ $_.WHAT ~ ") of absolute value for $_");
View
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 83;
+plan 71;
# L<S32::Numeric/Numeric/"=item exp">
@@ -15,24 +15,6 @@ Basic tests for the exp() builtin
my $e_to_the_fifth = 5497075/37039;
my $pi = 312689/99532;
-{
- is_approx(exp(:exponent(5)), $e_to_the_fifth, 'got the exponent of 5');
- is_approx(exp(:exponent(0)), 1, 'exp(:exponent(0)) == 1');
-
- is_approx(exp(:exponent(1i*$pi)), -1, 'exp(:exponent(i $pi)) == -1');
- is_approx(exp(:exponent(-1i*$pi)), -1, 'exp(:exponent(-i $pi)) == -1');
-
- is_approx(exp(:exponent(5), :base(10)), 100000, 'got the base-10 exponent of 5');
- is_approx(exp(:exponent(0), :base(10)), 1, 'exp(:exponent(0), :base(10)) == 1');
-
- is_approx(exp(:exponent(1i*$pi), :base(2)), 2 ** (1i * pi), 'exp(:exponent(i pi), :base(2)) == 2 ** (i * pi)');
- is_approx(exp(:base(1i*$pi), :exponent(2)), (1i * pi) ** 2, 'exp(:exponent(2), :base(i pi)) == (i * pi) ** 2');
- is_approx(exp(:exponent(1i*$pi), :base(2.Rat)), 2 ** (1i * pi), 'exp(:exponent(i pi), :base(2)) == 2 ** (i * pi)');
- is_approx(exp(:base(1i*$pi), :exponent(2.Rat)), (1i * pi) ** 2, 'exp(:exponent(2), :base(i pi)) == (i * pi) ** 2');
- is_approx(exp(:exponent(1i*$pi), :base(2.Num)), 2 ** (1i * pi), 'exp(:exponent(i pi), :base(2)) == 2 ** (i * pi)');
- is_approx(exp(:base(1i*$pi), :exponent(2.Num)), (1i * pi) ** 2, 'exp(:exponent(2), :base(i pi)) == (i * pi) ** 2');
-}
-
{
is_approx(5.exp, $e_to_the_fifth, '5.exp == e to the fifth');
is_approx(5.Rat.exp, $e_to_the_fifth, '5.Rat.exp == e to the fifth');

0 comments on commit c5fa27b

Please sign in to comment.