Skip to content

Commit 397ddee

Browse files
committed
Add tests for Supply.head
1 parent 76eac4d commit 397ddee

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

S17-supply/head.t

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use v6;
2+
use lib 't/spec/packages';
3+
4+
use Test;
5+
use Test::Tap;
6+
7+
plan 8;
8+
9+
dies-ok { Supply.head }, 'can not be called as a class method';
10+
dies-ok { Supply.new.head("foo") }, 'cannot have "foo" head';
11+
12+
for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER {
13+
diag "**** scheduling with {$*SCHEDULER.WHAT.perl}";
14+
15+
tap-ok Supply.from-list(1..10).head, [1,], "head without argument works";
16+
tap-ok Supply.from-list(1..10).head(5), [1..5], "head five works";
17+
tap-ok Supply.from-list(1..10).head(15), [1..10], "head 15 works";
18+
}

0 commit comments

Comments
 (0)