| 1 | package Test::Proto::Compare::Numeric; | ||||||||||
| 2 | 7 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 7 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 7 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 7 | extends 'Test::Proto::Compare'; | |||||||||
| 6 | |||||||||||
| 7 | 22 | ▶ | sub BUILDARGS { | ||||||||
|
Subroutine
BUILDARGS: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 8 | 22 | my $class = shift; | |||||||||
| 9 | return { | ||||||||||
| 10 | summary => '<=>', | ||||||||||
| 11 | 18 | ▶ | code => sub { $_[0] <=> $_[1] }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 22 | ▶ | ( exists( $_[0] ) ? ( code => $_[0] ) : () ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | }; | ||||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | =head1 NAME | ||||||||||
| 17 | |||||||||||
| 18 | Test::Proto::Compare::Numeric - numeric comparison | ||||||||||
| 19 | |||||||||||
| 20 | =head1 SYNOPSIS | ||||||||||
| 21 | |||||||||||
| 22 | my $c = Test::Proto::Compare::Numeric; | ||||||||||
| 23 | $c->compare($left, $right); # $left <=> $right | ||||||||||
| 24 | $c->reverse->compare($left, $right); # $right <=> $left | ||||||||||
| 25 | |||||||||||
| 26 | This class provides a wrapper for comparison functions so they can be identified by formatters. Except as described below, identical to L<Test::Proto::Compare>. | ||||||||||
| 27 | |||||||||||
| 28 | =head1 METHODS | ||||||||||
| 29 | |||||||||||
| 30 | =head3 code | ||||||||||
| 31 | |||||||||||
| 32 | Chainable attribute containing the code, which by default is a numeric comparison. | ||||||||||
| 33 | |||||||||||
| 34 | |||||||||||
| 35 | =head3 summary | ||||||||||
| 36 | |||||||||||
| 37 | Chainable attribute; a brief human-readable description of the operation which will be performed. Default is '<=>'. | ||||||||||
| 38 | |||||||||||
| 39 | =cut | ||||||||||
| 40 | |||||||||||
| 41 | 7 | 1; | |||||||||