blib/lib/UR/BoolExpr/Template/PropertyComparison/LessOrEqual.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 38 SCAR 30.0
CC
4
Cov
0%
_compare
20.0
BEGIN
2.0
BEGIN
2.0
CRAP 20.0
1  
2 package UR::BoolExpr::Template::PropertyComparison::LessOrEqual;
3  
4 use strict;
5 use warnings;
6 require UR;
7 our $VERSION = "0.46"; # UR $VERSION;
8  
9 UR::Object::Type->define(
10 class_name => __PACKAGE__,
11 is => ['UR::BoolExpr::Template::PropertyComparison'],
12 );
13  
14 sub _compare {
15 my ($class,$comparison_value,@property_value) = @_;
16  
17 my $cv_is_number = Scalar::Util::looks_like_number($comparison_value);
18  
19 no warnings 'uninitialized';
20 foreach my $property_value ( @property_value ) {
21 my $pv_is_number = Scalar::Util::looks_like_number($property_value);
22  
23 if ($cv_is_number and $pv_is_number) {
24 return 1 if ( $property_value <= $comparison_value );
25 } else {
26 return 1 if ( $property_value le $comparison_value );
27 }
28 }
29 return '';
30 }
31  
32  
33 1;
34  
35 =pod
36  
37 =head1 NAME
38  
39 UR::BoolExpr::Template::PropertyComparison::LessOrEqual - perform a less than or equal test
40  
41 =head1 DESCRIPTION
42  
43 If the property returns multiple values, this comparison returns true if any of the values are
44 less or equal to the comparison value
45  
46 =cut
47