Skip to content

Commit

Permalink
Document 'is test-assertion'
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Nov 14, 2022
1 parent 4e4d62a commit 8810019
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/Type/Routine.pod6
Expand Up @@ -407,6 +407,22 @@ sub þor() is raw {
þor()[1] = 'pantuflo';
say @zipi; # OUTPUT: «[zape pantuflo]␤»
=head2 trait is test-assertion
multi sub trait_mod:<is>(Routine:D, :$test-assertion!)
Declares that a routine generates test output (aka TAP). When
failures are reported, the calling routine's location is used instead
of this routine. For example:
=begin code
use Test;
sub foo-test($value) is test-assertion {
is $value, 42, "is the value 42?";
}
foo-test(666); # <-- error is reported on this line
=end code
=end pod

# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

0 comments on commit 8810019

Please sign in to comment.