Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add tests for RT #113590 (double angles in protoregex names).
  • Loading branch information
pmichaud committed Jun 25, 2012
1 parent 65b73e9 commit ea70649
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions S05-grammar/protoregex.t
@@ -1,14 +1,15 @@
use v6;
use Test;
plan 25;
plan 26;

grammar Alts {
token TOP { ^ <alt> $ };

proto token alt {*}
token alt:sym<foo> { <sym> };
token alt:sym<bar> { 'bar' };
token alt:sym<baz> { 'argl' };
token alt:sym«baz» { 'argl' }; # RT #113590
token alt:sym«=>» { <sym> }; # RT #113590
}

ok (my $match = Alts.parse('foo')), 'can parse with proto regexes (1)';
Expand All @@ -25,6 +26,9 @@ ok !Alts.parse('baz'), 'does not match sym of third alternative';
ok !Alts.parse('aldkfj'), 'does not match completely unrelated string';
ok !Alts.parse(''), 'does not match empty string';

# RT #113590
ok Alts.parse('=>'), 'can parse symbol inside double-angles';


class SomeActions {
method alt:sym<baz>($/) {
Expand Down

0 comments on commit ea70649

Please sign in to comment.