Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test documenting invocants
  • Loading branch information
hoelzro committed Jul 25, 2014
1 parent 329d202 commit 4575233
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
14 changes: 13 additions & 1 deletion S26-documentation/why-both.t
@@ -1,5 +1,5 @@
use Test;
plan 55;
plan 56;

#| simple case
class Simple {
Expand Down Expand Up @@ -135,3 +135,15 @@ sub has-anon-param(
$param = &has-anon-param.signature.params[0];

is $param.WHY, "leading\ntrailing", 'anonymous parameters should work';

class DoesntMatter {
method m(
#| invocant comment
::?CLASS $this:
#= another invocant comment
$arg
) {}
}

$param = DoesntMatter.^find_method('m').signature.params[0];
is $param.WHY, "invocant comment\nanother invocant comment", 'invocant comments should work';
13 changes: 12 additions & 1 deletion S26-documentation/why-leading.t
@@ -1,5 +1,5 @@
use Test;
plan 97;
plan 98;

#| simple case
class Simple {
Expand Down Expand Up @@ -195,3 +195,14 @@ sub has-anon-param(
my $param = &has-anon-param.signature.params[0];

is $param.WHY, 'leading', 'anonymous parameters should work';

class DoesntMatter {
method m(
#| invocant comment
::?CLASS $this:
$arg
) {}
}

$param = DoesntMatter.^find_method('m').signature.params[0];
is $param.WHY, 'invocant comment', 'invocant comments should work';
13 changes: 12 additions & 1 deletion S26-documentation/why-trailing.t
@@ -1,5 +1,5 @@
use Test;
plan 84;
plan 85;

class Simple {
#= simple case
Expand Down Expand Up @@ -177,3 +177,14 @@ sub has-anon-param(
$param = &has-anon-param.signature.params[0];

is $param.WHY, 'trailing', 'anonymous parameters should work';

class DoesntMatter {
method m(
::?CLASS $this:
#= invocant comment
$arg
) {}
}

$param = DoesntMatter.^find_method('m').signature.params[0];
is $param.WHY, 'invocant comment', 'invocant comments should work';

0 comments on commit 4575233

Please sign in to comment.