Skip to content

Commit 23817f0

Browse files
committed
test Failure.exception
1 parent 0fcb566 commit 23817f0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

S04-exceptions/fail.t

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 10;
5+
plan 12;
66

77
# L<S04/Exceptions/The fail function>
88

@@ -55,6 +55,13 @@ plan 10;
5555
isa_ok $rt77946.defined, Bool, 'Failure.defined returns a Bool';
5656
}
5757

58+
# RT #106832
59+
{
60+
my $f = (sub { fail('foo') }).();
61+
is $f.exception, 'foo', 'can extract exception from Failure';
62+
isa_ok $f.exception, Exception, '... and it is an Exception';
63+
}
64+
5865
done;
5966

6067
# vim: ft=perl6

0 commit comments

Comments
 (0)