Skip to content

Commit cec838d

Browse files
committed
Test where with regex + block
Closes rakudo/rakudo#1481 Rakudo fix: rakudo/rakudo@c0c7756f4b
1 parent d05a949 commit cec838d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

S05-metasyntax/regex.t

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use lib <t/spec/packages/>;
33
use Test;
44
use Test::Util;
55

6-
plan 51;
6+
plan 52;
77

88
throws-like 'qr/foo/', X::Obsolete, 'qr// is gone';
99

@@ -280,4 +280,15 @@ is ~("ddd" ~~ / [ x | d ] **? 2..3 /), "dd", 'frugal match with alternation';
280280
is_run /a/; print "pass", {:out<pass>, :err(''), :0status},
281281
'/a/ in sink context in in uppermost scope does not explode';
282282

283+
# https://github.com/rakudo/rakudo/issues/1481
284+
{
285+
my @res;
286+
multi sub foo($x where /{@res.push: $x}./) {}
287+
multi sub foo($y where /{@res.push: $y}./) {}
288+
foo 'a';
289+
foo 'b';
290+
is-deeply @res, [<a a b b>],
291+
'regex blocks update their lexical variables right';
292+
}
293+
283294
# vim: ft=perl6

0 commit comments

Comments
 (0)