Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make it clearer cmp-ok can take a Callable
  • Loading branch information
zoffixznet committed Jun 17, 2016
1 parent 5299b4f commit 6b0b678
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/Language/testing.pod
Expand Up @@ -249,6 +249,11 @@ accepts an optional C<$description> of the test.
cmp-ok 'my spelling is apperling', '~~', /perl/, "bad speller";
The C<$comparison> can be any L<Callable>, allowing you to use custom comparisons:
cmp-ok 2, sub { $^a.is-prime and $^b.is-prime and $^a < $^b }, 7,
'we got primes, one larger than the other!';
B<Note:> user-defined operators cannot be passed as strings. Use
the C<&[]> notation instead:
Expand Down

0 comments on commit 6b0b678

Please sign in to comment.