Proto/Compare/Numeric.pm

filter: Statementstmt 100% 14 / 14 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 90.9% 20 / 22 CC 2 SCAR 3.0
CC
2
Cov
94%
BUILDARGS
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Proto/Role/HashRef.pm ↑ Summary Proto/Compare.pm »
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
BranchTrueFalseTotal
exists $_[0] ? : 0 22 22
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;
« Proto/Role/HashRef.pm ↑ Summary Proto/Compare.pm »