Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
S26: Add test for trailing comments on roles, grammars, etc
  • Loading branch information
hoelzro committed Aug 8, 2014
1 parent f9c0392 commit f5eef00
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion S26-documentation/why-trailing.t
@@ -1,5 +1,5 @@
use Test;
plan 157;
plan 206;

my $pod_index = 0;

Expand Down Expand Up @@ -159,4 +159,46 @@ class DoesntMatter {
test-trailing(@params[0], 'invocant comment');
}

role Boxer {
#= Are you talking to me?
method actor { }
#= Robert De Niro
}

{
my $method = Boxer.^find_method('actor');
test-trailing(Boxer, 'Are you talking to me?');
test-trailing($method, 'Robert De Niro');
}

class C {
submethod BUILD { }
#= Bob
}

{
my $submethod = C.^find_method("BUILD");
test-trailing($submethod, 'Bob');
}

grammar G {
#= grammar
rule R { <?> }
#= rule
token T { <?> }
#= token
regex X { <?> }
#= regex
}

{
my $rule = G.^find_method("R");
my $token = G.^find_method("T");
my $regex = G.^find_method("X");
test-trailing(G, 'grammar');
test-trailing($rule, 'rule');
test-trailing($token, 'token');
test-trailing($regex, 'regex');
}

is $=pod.elems, $pod_index;

0 comments on commit f5eef00

Please sign in to comment.