Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove custom operators work-around prose for cmp-ok
It now fully supports user-defined operators passed as Str
  • Loading branch information
zoffixznet committed Jun 18, 2016
1 parent d838de5 commit 34b0873
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions doc/Language/testing.pod
Expand Up @@ -247,7 +247,8 @@ passes the test if the comparison yields a C<True> value. The C<$description>
of the test is optional.
The C<$comparison> comparator can be either a L<Callable> or
a L<Str> containing a I<core> infix operator, such as C<'=='> or C<'~~'>.
a L<Str> containing aninfix operator, such as C<'=='>, a C<'~~'>, or a
user-defined infix.
cmp-ok 'my spelling is apperling', '~~', /perl/, "bad speller";
Expand All @@ -259,12 +260,6 @@ A L<Callable> C<$comparison> lets you use custom comparisons:
cmp-ok 2, -> $a, $b { $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 to create a L<Callable> for them instead:
sub infix:<◀> { $^a < $^b };
cmp-ok 4, &[◀], 5, 'comparing using my fancy operator';
=head2 By object type
=item X<isa-ok($value, $expected-type, $description?)|isa-ok>
Expand Down

0 comments on commit 34b0873

Please sign in to comment.