Skip to content

Commit

Permalink
Merge pull request #617 from kbucheli/properly_close_channel_supply
Browse files Browse the repository at this point in the history
channel elements not yet consumed in the supply should still be accessible
  • Loading branch information
jnthn committed Feb 11, 2020
2 parents ebf9054 + b458b1d commit e4ffee2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S17-channel/basic.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 27;
plan 28;

{
my Channel $c .= new;
Expand Down Expand Up @@ -94,6 +94,16 @@ plan 27;
$timer.close;
}

{
my $c = Channel.new;
$c.send(1);
$c.send(2);

react whenever $c { done }

is $c.poll, 2, 'second value should still be in the channel';
}

{ # coverage; 2016-09-26
throws-like { Channel.elems }, Exception, 'Channel:U.elems fails';
throws-like { Channel.new.elems }, Exception, 'Channel:D.elems fails';
Expand Down

0 comments on commit e4ffee2

Please sign in to comment.