Skip to content

Commit ae245a6

Browse files
committed
Add test for RT #83508
1 parent 390f04d commit ae245a6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

S05-match/capturing-contexts.t

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use MONKEY_TYPING;
44
use Test;
55
use lib 't/spec/packages';
66
use Test::Util;
7-
plan 44;
7+
plan 46;
88

99
# old: L<S05/Return values from matches/"A match always returns a Match object" >
1010
# L<S05/Match objects/"A match always returns a " >
@@ -172,6 +172,13 @@ plan 44;
172172
isa_ok $/, Cool, "Match is Cool";
173173
}
174174

175+
# RT #83508
176+
{
177+
'x' ~~ /(y)? (z)*/;
178+
is $0.defined, False, 'quantifier ? matching 0 values returns Nil';
179+
is $1.defined, True, 'quantifier * matching 0 values returns empty list';
180+
}
181+
175182
done;
176183

177184
# vim: ft=perl6

0 commit comments

Comments
 (0)