Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More leading doc parameter tests
  • Loading branch information
hoelzro committed Jul 21, 2014
1 parent 74bb756 commit 97a1482
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions S26-documentation/why-leading.t
@@ -1,5 +1,5 @@
use Test;
plan 79;
plan 87;

#| simple case
class Simple {
Expand Down Expand Up @@ -156,4 +156,22 @@ is &has-two-params.signature.params[0].WHY, 'documented';
ok &has-two-params.signature.params[0].WHY.WHEREFORE === &has-two-params.signature.params[0], 'param WHEREFORE matches';
is &has-two-params.signature.params[0].WHY.leading, 'documented';
ok !&has-two-params.signature.params[0].WHY.trailing.defined;
ok !&has-two-params.signature.params[1].WHY.defined or diag(&has-two-params.signature.params[1].WHY.content);
ok !&has-two-params.signature.params[1].WHY.defined, 'Second param should not be documented' or diag(&has-two-params.signature.params[1].WHY.content);

sub both-documented(
#| documented
Str $param,
#| I too, am documented
Int $second
) {}

skip "this isn't working yet", 8;
#is &both-documented.signature.params[0].WHY, 'documented';
#ok &both-documented.signature.params[0].WHY.WHEREFORE === &both-documented.signature.params[0], 'param WHEREFORE matches';
#is &both-documented.signature.params[0].WHY.leading, 'documented';
#ok !&both-documented.signature.params[0].WHY.trailing.defined;

#is &both-documented.signature.params[1].WHY, 'I too, am documented';
#ok &both-documented.signature.params[1].WHY.WHEREFORE === &both-documented.signature.params[0], 'param WHEREFORE matches';
#is &both-documented.signature.params[1].WHY.leading, 'I too, am documented';
#ok !&both-documented.signature.params[1].WHY.trailing.defined;

0 comments on commit 97a1482

Please sign in to comment.