We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0bc46d commit c074558Copy full SHA for c074558
S17-supply/return-in-tap.t
@@ -0,0 +1,28 @@
1
+use Test;
2
+plan 1;
3
+
4
+sub dying($in) {
5
+ supply {
6
+ whenever $in {
7
+ die "oh no";
8
+ }
9
10
+}
11
12
+my $caught = 0;
13
14
+sub try-it() {
15
+ my $fake-in = Supplier.new;
16
+ dying($fake-in.Supply).tap:
17
+ quit => -> $exception {
18
+ $caught++;
19
+ return;
20
+ };
21
+ $fake-in.emit("XXX");
22
23
24
+for ^200 {
25
+ try-it;
26
27
28
+is $caught, 200, 'return in a Supply quit handler works fine';
0 commit comments