Skip to content

Commit

Permalink
Test if Supply.throttle($, $second) become done when its source becom…
Browse files Browse the repository at this point in the history
…e done
  • Loading branch information
FCO committed Nov 25, 2017
1 parent bb35ffc commit 994394c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion S17-supply/throttle.t
Expand Up @@ -3,7 +3,7 @@ use lib 't/spec/packages';

use Test;

plan 17;
plan 18;

dies-ok { Supply.throttle(1,1) }, 'can not be called as a class method';

Expand Down Expand Up @@ -97,4 +97,18 @@ diag "**** scheduling with {$*SCHEDULER.WHAT.perl}";
}
}

subtest {
react {
whenever Supply.from-list(^4).throttle(4, .1) {
is $_, $++, "throttle isnt done yet";
LAST { done }
}
whenever Promise.in(10) {
flunk "throttle timed out";
done
}
}

}, "Supply.throttle(\$, \$second) should become done when the source supply become done";

# vim: ft=perl6 expandtab sw=4

0 comments on commit 994394c

Please sign in to comment.