Permalink
Browse files

Remove (:DEFAULT) and plan *.

  • Loading branch information...
1 parent dbd0eb6 commit adf31e26c720d84b490eab0a9d80f81b8e77bb7b @colomon committed Feb 4, 2012
Showing with 8 additions and 20 deletions.
  1. +8 −8 lib/List/Utils.pm
  2. +0 −2 t/01-sliding-window.t
  3. +0 −3 t/02-permute.t
  4. +0 −2 t/03-take-while.t
  5. +0 −1 t/04-transpose.t
  6. +0 −2 t/05-search.t
  7. +0 −2 t/06-sorted-merge.t
View
@@ -1,6 +1,6 @@
module List::Utils;
-sub sliding-window(@a, $n) is export(:DEFAULT) {
+sub sliding-window(@a, $n) is export {
my $a-list = @a.iterator.list;
my @values;
gather while defined(my $a = $a-list.shift) {
@@ -10,7 +10,7 @@ sub sliding-window(@a, $n) is export(:DEFAULT) {
}
}
-sub sliding-window-wrapped(@a, $n) is export(:DEFAULT) {
+sub sliding-window-wrapped(@a, $n) is export {
my $a-list = @a.iterator.list;
my @values;
gather {
@@ -28,7 +28,7 @@ sub sliding-window-wrapped(@a, $n) is export(:DEFAULT) {
}
}
-sub permute(@items) is export(:DEFAULT) {
+sub permute(@items) is export {
sub pattern_to_permutation(@pattern, @items1) {
my @items = @items1;
my @r;
@@ -55,7 +55,7 @@ sub permute(@items) is export(:DEFAULT) {
}
}
-sub take-while(@a, Mu $test) is export(:DEFAULT) {
+sub take-while(@a, Mu $test) is export {
gather {
for @a.list {
when $test { take $_ }
@@ -64,7 +64,7 @@ sub take-while(@a, Mu $test) is export(:DEFAULT) {
}
}
-sub transpose(@list is copy) is export(:DEFAULT) {
+sub transpose(@list is copy) is export {
gather {
while @list {
my @heads;
@@ -80,7 +80,7 @@ sub transpose(@list is copy) is export(:DEFAULT) {
}
}
-sub lower-bound(@x, $key) is export(:DEFAULT) {
+sub lower-bound(@x, $key) is export {
my $first = 0;
my $len = @x.elems;
my $half;
@@ -100,7 +100,7 @@ sub lower-bound(@x, $key) is export(:DEFAULT) {
return $first;
}
-sub upper-bound(@x, $key) is export(:DEFAULT) {
+sub upper-bound(@x, $key) is export {
my $first = 0;
my $len = @x.elems;
my $half;
@@ -120,7 +120,7 @@ sub upper-bound(@x, $key) is export(:DEFAULT) {
return $first;
}
-sub sorted-merge(@a, @b, &by = &infix:<cmp>) is export(:DEFAULT) {
+sub sorted-merge(@a, @b, &by = &infix:<cmp>) is export {
my $a-list = @a.iterator.list;
my $b-list = @b.iterator.list;
View
@@ -1,8 +1,6 @@
use Test;
use List::Utils;
-plan *;
-
is ~sliding-window((1, 2, 3), 1), ~(1, 2, 3), "one at a time works (parcel)";
is ~sliding-window(1..3, 1), ~(1, 2, 3), "one at a time works (range)";
# is ~sliding-window(1...3, 1), ~(1, 2, 3), "one at a time works (series)";
View
@@ -1,11 +1,8 @@
use Test;
use List::Utils;
-plan *;
-
{
my @a = permute((1, 2, 3));
- say :@a.perl;
is @a.elems, 6, "(1, 2, 3) has 6 permutations";
}
View
@@ -1,8 +1,6 @@
use Test;
use List::Utils;
-plan *;
-
is take-while((1...*), * <= 10), ~(1...10), "take-while works on a basic infinite loop";
is take-while((1...*), * <= -1), "", "take-while works if condition is initially false";
View
@@ -1,7 +1,6 @@
use Test;
use List::Utils;
-plan *;
nok transpose(([])).elems, "empty matrix";
is transpose(([],[])), (), "empty matrix";
is transpose(([1])), ([1]), "one element matrix";
View
@@ -2,8 +2,6 @@ use v6;
use Test;
use List::Utils;
-plan *;
-
my @array = (1, 2, 2, 3, 4, 5, 5, 5, 5, 6, 7, 8);
ok(([<=] @array), "array is sorted properly");
View
@@ -2,8 +2,6 @@ use v6;
use Test;
use List::Utils;
-plan *;
-
{
my @a = (10, 20, 20, 30);
my @b = 17..22;

0 comments on commit adf31e2

Please sign in to comment.