Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add :elems/:overlap tests for Supply.buffering

Timed buffering is a bit trickier to test, more on that later
commit 162bbf4c3c28796ae1d6e20a5e6ca689b5b47f92 1 parent 77fbcff
lizmat authored April 20, 2014

Showing 1 changed file with 9 additions and 1 deletion. Show diff stats Hide diff stats

  1. 10  S17-concurrency/supply.t
10  S17-concurrency/supply.t
... ...
@@ -1,7 +1,7 @@
1 1
 use v6;
2 2
 use Test;
3 3
 
4  
-plan 182;
  4
+plan 194;
5 5
 
6 6
 sub tap_ok ( $s, $expected, $text ) {
7 7
     ok $s ~~ Supply, "{$s.^name} appears to be doing Supply";
@@ -289,4 +289,12 @@ for (ThreadPoolScheduler, CurrentThreadScheduler) {
289 289
         ok $done, "the merged supply was really done";
290 290
         is_deeply @res.sort, [1..15], "merging 3 supplies works";
291 291
 }
  292
+
  293
+    tap_ok Supply.for(1..14).buffering(:elems(5)),
  294
+      [[1..5],[6..10],[11..14]],
  295
+      "we can buffer by number of elements";
  296
+
  297
+    tap_ok Supply.for(1..5).buffering(:elems(2), :overlap(1)),
  298
+      [[1,2],[2,3],[3,4],[4,5],[5]],
  299
+      "we can buffer by number of elements and overlap";
292 300
 }

0 notes on commit 162bbf4

Please sign in to comment.
Something went wrong with that request. Please try again.