Skip to content

Commit 635b34a

Browse files
committed
Bring .tap tests up to spec
1 parent bcdb5a5 commit 635b34a

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

S17-concurrency/channel.t

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ plan 14;
3333
is $c.closed.cause.message, "oh noes", "failure reason conveyed";
3434
}
3535

36-
#?rakudo skip 'disappears'
3736
{
3837
my $p = Supply.for(1..5);
39-
is ~$p.Channel.list, "1 2 3 4 5", "Publish.for and .Channel work";
38+
is ~$p.Channel.list, "1 2 3 4 5", "Supply.for and .Channel work";
4039
}
4140

42-
#?rakudo skip 'disappears'
41+
#?rakudo skip 'hangs'
4342
{
4443
my $p = Supply.for(1..5);
45-
is ~@($p.Channel), "1 2 3 4 5", "Publish.for and @(.Channel) work";
44+
is ~@($p.Channel), "1 2 3 4 5", "Supply.for and @(.Channel) work";
4645
}

S17-concurrency/supply.t

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ plan 16;
88

99
my @vals;
1010
my $saw_done;
11-
my $tap = $p.tap(
12-
-> $val { @vals.push($val) },
13-
{ $saw_done = True });
11+
my $tap = $p.tap( -> $val { @vals.push($val) },
12+
done => { $saw_done = True });
1413

1514
$p.more(1);
1615
is ~@vals, "1", "Tap got initial value";
@@ -48,15 +47,13 @@ plan 16;
4847
my $p = Supply.for(1..10, :scheduler(CurrentThreadScheduler));
4948

5049
my @a1;
51-
my $tap1 = $p.tap(
52-
-> $val { @a1.push($val) },
53-
{ @a1.push("end") });
50+
my $tap1 = $p.tap( -> $val { @a1.push($val) },
51+
done => { @a1.push("end") });
5452
is ~@a1, "1 2 3 4 5 6 7 8 9 10 end", "Synchronous publish worked";
5553

5654
my @a2;
57-
my $tap2 = $p.tap(
58-
-> $val { @a2.push($val) },
59-
{ @a2.push("end") });
55+
my $tap2 = $p.tap( -> $val { @a2.push($val) },
56+
done => { @a2.push("end") });
6057
is ~@a2, "1 2 3 4 5 6 7 8 9 10 end", "Second tap also gets all values";
6158
}
6259

0 commit comments

Comments
 (0)