Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Type-based test for Channel.fail/receive exception throwing
  • Loading branch information
moritz committed Dec 21, 2014
1 parent a0bfc72 commit 0ab7746
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion S17-channel/basic.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 14;
plan 15;

{
my Channel $c .= new;
Expand Down Expand Up @@ -33,6 +33,13 @@ plan 14;
is $c.closed.cause.message, "oh noes", "failure reason conveyed";
}

{
my class X::Roast::Channel is Exception { };
my $c = Channel.new;
$c.fail(X::Roast::Channel.new);
throws_like { $c.receive }, X::Roast::Channel;
}

{
my $p = Supply.for(1..5);
is ~$p.Channel.list, "1 2 3 4 5", "Supply.for and .Channel work";
Expand Down

0 comments on commit 0ab7746

Please sign in to comment.