Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add tests for List.uniq(:as)
  • Loading branch information
lizmat committed Aug 4, 2013
1 parent 70ed9dc commit 3dd1995
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion S32-list/squish.t
Expand Up @@ -71,7 +71,7 @@ This test tests the C<squish> builtin and .squish method on Any/List.
is_deeply @array .= squish(:$as), [<a b c d e f a>],
"inplace form of squish with :as works";
is_deeply @array, [<a b c d e f a>],
"final result of in place";
"final result with :as in place";
} #4

# vim: ft=perl6
17 changes: 16 additions & 1 deletion S32-list/uniq.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 14;
plan 18;

=begin description
Expand Down Expand Up @@ -73,4 +73,19 @@ See the thread "[S32::Containers] uniq" on p6l, too.
is @uniq, @list, "uniq has === semantics";
} #1

#?pugs skip 'NYI'
#?niecza skip 'NYI'
{
my @array = <a b bb c d e b bbbb b b f b>;
my $as = {substr $^a,0,1};
is_deeply @array.uniq(:$as), <a b c d e f>.list.item,
"method form of uniq with :as works";
is_deeply uniq(@array,:$as), <a b c d e f>.list.item,
"subroutine form of uniq with :as works";
is_deeply @array .= uniq(:$as), [<a b c d e f>],
"inplace form of uniq with :as works";
is_deeply @array, [<a b c d e f>],
"final result with :as in place";
} #4

# vim: ft=perl6

0 comments on commit 3dd1995

Please sign in to comment.