Skip to content
Browse files

bring winner.t up to latest spec and unfudge

  • Loading branch information...
1 parent 0fed404 commit 88422675f6629f31f8218b4a6eeabd1dfdd42cf4 @timo timo committed Dec 18, 2013
Showing with 8 additions and 8 deletions.
  1. +8 −8 S17-concurrency/winner.t
View
16 S17-concurrency/winner.t
@@ -3,31 +3,31 @@ use Test;
plan 4;
-#?rakudo skip 'syntax not valid yet'
+#?rakudo.parrot skip 'no implementation of promise/winner'
{
my $p1 = Promise.in(1);
my $p2 = Promise.in(2);
my @seen;
- is( do winner * {
+ is( winner * {
done $p1 { @seen.push: 'a'; 'first' }
done $p2 { @seen.push: 'b'; 'second' }
}, 'first', 'did we get the first promise' );
- is( do winner * {
+ is(winner * {
done $p2 { @seen.push: 'b'; 'second' }
}, 'second', 'did we get the second promise' );
is ~@seen, 'a b', 'did promises fire in right order';
}
-#?rakudo skip 'syntax not valid yet'
+#?rakudo.parrot skip 'no implementation of supply/winner'
{
- my $p = Publish.for(1..5);
+ my $p = Supply.for(1..5);
my $c = $p.Channel;
my @a;
loop {
winner $c {
- more * => { say "pushing"; @a.push($^val) },
- done * => { say "done"; @a.push("done"); last }
- );
+ more * -> $val { @a.push($val) }
+ done * -> { @a.push("done"); last }
+ }
}
is ~@a, "1 2 3 4 5 done", "Publish.for and .Channel work";
}

0 comments on commit 8842267

Please sign in to comment.
Something went wrong with that request. Please try again.