Skip to content

Commit

Permalink
tests for RT #73680
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Oct 25, 2011
1 parent 5444422 commit 87785c0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions S05-grammar/methods.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 3;
plan 5;

grammar WithMethod {
rule TOP { 'lorem' | <.panic> }
Expand All @@ -21,4 +21,9 @@ grammar WithOuterLex {
WithOuterLex.parse('xxx');
is $x, 42, 'regex in a grammar can see outer lexicals';

done;
grammar WithAttrib {
has Str $.sep;
}
# RT #73680
is WithAttrib.new(sep => ',').sep, ',', 'attributes work in grammars too';
isa_ok WithAttrib.new.sep, Str, 'empty attribute intilized to Str';

0 comments on commit 87785c0

Please sign in to comment.