Skip to content

Commit a115250

Browse files
committed
Start winner.t by taking winner test from supply.t
1 parent 987bced commit a115250

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

S17-concurrency/supply.t

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,6 @@ plan 17;
6060
is ~@a2, "1 2 3 4 5 6 7 8 9 10 end", "Second tap also gets all values";
6161
}
6262

63-
{
64-
my $p = Publish.for(1..5);
65-
my $c = $p.Channel;
66-
my @a;
67-
loop {
68-
winner(
69-
$c => { @a.push($^val) },
70-
$c.closed => { @a.push("done"); last }
71-
);
72-
}
73-
is ~@a, "1 2 3 4 5 done", "Publish.for and .Channel work";
74-
}
75-
7663
{
7764
my $p = Publish.for(2..6);
7865
my @a;

S17-concurrency/winner.t

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use v6;
2+
use Test;
3+
4+
plan 1;
5+
6+
{
7+
my $p = Publish.for(1..5);
8+
my $c = $p.Channel;
9+
my @a;
10+
loop {
11+
winner(
12+
$c => { say "pushing"; @a.push($^val) },
13+
default => { say "done"; @a.push("done"); last }
14+
);
15+
}
16+
is ~@a, "1 2 3 4 5 done", "Publish.for and .Channel work";
17+
}

0 commit comments

Comments
 (0)