Skip to content

Commit 2d7448c

Browse files
committed
Tests covering some QUIT phaser bugs.
1 parent 8265429 commit 2d7448c

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

S17-supply/syntax.t

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 62;
4+
plan 65;
55

66
{
77
my $s = supply {
@@ -453,4 +453,28 @@ throws-like 'done', X::ControlFlow, illegal => 'done';
453453
is await(foo(69)), 69, 'LAST in whenever triggered without iterations sees correct outer (2)';
454454
}
455455

456+
lives-ok {
457+
react {
458+
whenever Supply.from-list(gather { die }) {
459+
QUIT { default { } }
460+
}
461+
}
462+
}, 'QUIT properly handles exception even when dieing synchronously with the .tap';
463+
464+
{
465+
sub foo($a) {
466+
supply {
467+
whenever Supply.from-list(gather { die }) {
468+
QUIT {
469+
default {
470+
emit $a;
471+
}
472+
}
473+
}
474+
}
475+
}
476+
is await(foo(42)), 42, 'QUIT in whenever triggered without iterations sees correct outer (1)';
477+
is await(foo(69)), 69, 'QUIT in whenever triggered without iterations sees correct outer (2)';
478+
}
479+
456480
# vim: ft=perl6 expandtab sw=4

0 commit comments

Comments
 (0)