Skip to content

Commit

Permalink
Add basic tests for Supply.tap
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed May 1, 2014
1 parent c0fc454 commit 9c839e2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions S17-supply/act.t
@@ -0,0 +1,19 @@
use v6;
use lib 't/spec/packages';

use Test;

plan 6;

for (ThreadPoolScheduler, CurrentThreadScheduler) {
$*SCHEDULER = .new;
isa_ok $*SCHEDULER, $_, "***** scheduling with {$_.gist}";

{
my @seen;
my $tap = Supply.for(1..10).act( { @seen.push($_) } );
isa_ok $tap, Tap, 'we got a Tap';
sleep .1 until @seen == 10;
is_deeply @seen, [1..10], 'we got all of the values';
}
}

0 comments on commit 9c839e2

Please sign in to comment.