Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tests for RT #77152 (<&foo($arg)>).
  • Loading branch information
jnthn committed Apr 28, 2015
1 parent 8ab25b4 commit f3d73db
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S05-interpolation/lexicals.t
@@ -1,5 +1,5 @@
use Test;
plan 10;
plan 14;

my regex abc { abc }

Expand All @@ -19,5 +19,15 @@ ok 'fooabcdef' ~~ / . <other=&abc> . /, '<other=&abc> captures lexical regex';
is ~$/, 'oabcd', 'correctly matched string';
is $<other>, 'abc', 'correctly captured to $<other>';

# RT #77152
{
my regex foo($s) { $s };

ok 'a' ~~ / <&foo('a')> /, '<&foo(...)> parses and passes args correctly (1)';
nok 'a' ~~ / <&foo('b')> /, '<&foo(...)> parses and passes args correctly (2)';

ok 'c' ~~ / <&foo: 'c'> /, '<&foo: ...> parses and passes args correctly (1)';
nok 'c' ~~ / <&foo: 'd'> /, '<&foo: ...> parses and passes args correctly (2)';
}

done;

0 comments on commit f3d73db

Please sign in to comment.