Skip to content

Commit ecd28b5

Browse files
committed
Add and run Supply.collate tests
1 parent b7e2c2c commit ecd28b5

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

S17-supply/collate.t

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
use v6;
2+
use Test;
3+
use lib $?FILE.IO.parent(2).add("packages/Test-Helpers");
4+
use Test::Tap;
5+
use Test::Util;
6+
7+
plan 7;
8+
9+
is-eqv Supply.collate, (Supply,).Seq, 'can sort a Supply type object';
10+
11+
for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER {
12+
diag "**** scheduling with {$*SCHEDULER.WHAT.raku}";
13+
14+
tap-ok Supply.from-list(10...1).collate, [1,10,2,3,4,5,6,7,8,9],
15+
"we can collate numbers (always treated as strings)";
16+
tap-ok Supply.from-list("z"..."a").collate, ["a" .. "z"],
17+
"we can collate strings";
18+
tap-ok Supply.from-list(flat("a".."d", "A" .. "D")).collate,
19+
[<a A b B c C d D>],
20+
"we can collate mixed case";
21+
}
22+
23+
# vim: ft=perl6 expandtab sw=4

spectest.data

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ S17-supply/batch.t # slow
897897
S17-supply/categorize.t
898898
S17-supply/Channel.t
899899
S17-supply/classify.t
900+
S17-supply/collate.t
900901
S17-supply/comb.t
901902
S17-supply/decode.t
902903
S17-supply/delayed.t # slow

0 commit comments

Comments
 (0)