Skip to content

Commit 089e2ef

Browse files
committed
Add tests for Supply.comb(Regex)
1 parent cf20644 commit 089e2ef

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

S17-supply/comb.t

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use Test::Tap;
66
my @source = <old dog jumpso>;
77
my @schedulers = ThreadPoolScheduler.new, CurrentThreadScheduler;
88

9-
plan @schedulers * 13;
9+
plan @schedulers * 16;
1010

1111
for @schedulers -> $*SCHEDULER {
1212
diag "**** scheduling with {$*SCHEDULER.WHAT.raku}";
@@ -17,9 +17,11 @@ for @schedulers -> $*SCHEDULER {
1717
"comb a simple list of words with {c.raku.substr(1)}";
1818
}
1919

20-
tap-ok Supply.from-list(@source).comb(2),
21-
[<ol dd og ju mp so>],
22-
"comb a simple list of words for 2 chars at a time exactly";
20+
for \(2), \(/../) -> \c {
21+
tap-ok Supply.from-list(@source).comb(|c),
22+
[<ol dd og ju mp so>],
23+
"comb a simple list of words with {c.raku.substr(1)}";
24+
}
2325

2426
tap-ok Supply.from-list(@source).comb(2,2),
2527
[<ol dd>],
@@ -31,19 +33,29 @@ for @schedulers -> $*SCHEDULER {
3133
"comb a simple list of words with {c.raku.substr(1)}";
3234
}
3335

34-
tap-ok Supply.from-list(@source).comb(20),
35-
['olddogjumpso'],
36-
"comb a simple list of words for 20 chars at a time";
36+
for \(/...../) -> \c {
37+
tap-ok Supply.from-list(@source).comb(|c),
38+
[<olddo gjump>],
39+
"comb a simple list of words with {c.raku.substr(1)}";
40+
}
41+
42+
for \(20) -> \c {
43+
tap-ok Supply.from-list(@source).comb(|c),
44+
['olddogjumpso'],
45+
"comb a simple list of words with {c.raku.substr(1)}";
46+
}
3747

3848
for \("o"), \("o",Inf), \("o",*) -> \c {
3949
tap-ok Supply.from-list(@source).comb(|c),
4050
[<o o o>],
4151
"comb a simple list of words with {c.raku.substr(1)}";
4252
}
4353

44-
tap-ok Supply.from-list(@source).comb('z'),
45-
[],
46-
"comb a simple list of words for a Str needle that is not there";
54+
for \('z'), \(/.**20/) -> \c {
55+
tap-ok Supply.from-list(@source).comb(|c),
56+
[],
57+
"comb a simple list of words with {c.raku.substr(1)}";
58+
}
4759
}
4860

4961
# vim: ft=perl6 expandtab sw=4

0 commit comments

Comments
 (0)