Skip to content

Commit 34b0873

Browse files
authored
Remove custom operators work-around prose for cmp-ok
It now fully supports user-defined operators passed as Str
1 parent d838de5 commit 34b0873

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

doc/Language/testing.pod

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ passes the test if the comparison yields a C<True> value. The C<$description>
247247
of the test is optional.
248248
249249
The C<$comparison> comparator can be either a L<Callable> or
250-
a L<Str> containing a I<core> infix operator, such as C<'=='> or C<'~~'>.
250+
a L<Str> containing aninfix operator, such as C<'=='>, a C<'~~'>, or a
251+
user-defined infix.
251252
252253
cmp-ok 'my spelling is apperling', '~~', /perl/, "bad speller";
253254
@@ -259,12 +260,6 @@ A L<Callable> C<$comparison> lets you use custom comparisons:
259260
cmp-ok 2, -> $a, $b { $a.is-prime and $b.is-prime and $a < $b }, 7,
260261
'we got primes, one larger than the other!';
261262
262-
B<Note:> user-defined operators cannot be passed as strings. Use
263-
the C<&[]> notation to create a L<Callable> for them instead:
264-
265-
sub infix:<◀> { $^a < $^b };
266-
cmp-ok 4, &[◀], 5, 'comparing using my fancy operator';
267-
268263
=head2 By object type
269264
270265
=item X<isa-ok($value, $expected-type, $description?)|isa-ok>

0 commit comments

Comments
 (0)