Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tests for Supply.squish
  • Loading branch information
lizmat committed Apr 18, 2014
1 parent 647d15e commit a902f51
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion S17-concurrency/supply.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 78;
plan 90;

sub tap_ok ( $s, $expected, $text ) {
ok $s ~~ Supply, "{$s.^name} appears to be doing Supply";
Expand Down Expand Up @@ -101,6 +101,28 @@ for (ThreadPoolScheduler, CurrentThreadScheduler) {
'a B cc',
"uniq with as and with tap works";

# tap_ok Supply.for(1..10,1..10).squish,
# '1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10',
# "squish tap with 2 ranges works";

# tap_ok Supply.for(1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10).squish,
# '1 2 3 4 5 6 7 8 9 10',
# "squish tap with doubling range works";

# tap_ok Supply.for(1..10).squish(:as(* div 2)),
# '1 2 4 6 8 10',
# "squish with as tap works";

tap_ok Supply.for(<a A B b c C A>).squish( :with( {$^a.lc eq $^b.lc} ) ),
'a B c A',
"squish with with tap works";

tap_ok Supply.for(<a AA B bb cc C AA>).squish(
:as( *.substr(0,1) ), :with( {$^a.lc eq $^b.lc} )
),
'a B cc AA',
"squish with as and with tap works";

{
my $s1 = Supply.new;
my $s2 = Supply.new;
Expand Down

0 comments on commit a902f51

Please sign in to comment.