Skip to content

Commit

Permalink
Test repeated(:as, :with) in Any-iterable-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterDuke17 committed Sep 8, 2016
1 parent 34ad043 commit c498bcc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion S32-list/repeated.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 34;
plan 38;

=begin description
Expand Down Expand Up @@ -131,6 +131,21 @@ This test tests the C<repeated> builtin.
"final result with [eqv] and objects in place";
} #4

# :with and :as
{
my @array = ({:a<1>}, {:B<1>}, {:A<1>}, {:b<1>});
my $as = &lc;
my $with = &[eqv];
is-deeply @array.repeated(:$as, :$with).List, ({:A<1>}, {:b<1>}),
"method form of repeated with :as and :with and objects works";
is-deeply repeated(@array, :$as, :$with).List, ({:A<1>}, {:b<1>}),
"subroutine form of repeated with :as and :with and objects works";
is-deeply @array .= repeated(:$as, :$with), [{:A<1>}, {:b<1>}],
"inplace form of repeated with :as and :with and objects works";
is-deeply @array, [{:A<1>}, {:b<1>}],
"final result with :as and :with and objects in place";
} #4

{
my %a;
%a<foo> = <a b c b c>;
Expand Down

0 comments on commit c498bcc

Please sign in to comment.