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

filter: Statementstmt 0.0% 0 / 19 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 27 SCAR 17.9
CC
2
Cov
0%
_compare
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 6.0
1  
2 package UR::BoolExpr::Template::PropertyComparison::Matches;
3  
4 use strict;
5 use warnings;
6 use 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 no warnings 'uninitialized';
17 foreach my $property_value ( @property_value ) {
18 return 1 if ( $property_value =~ m/$comparison_value/ );
19 }
20 return '';
21 }
22  
23  
24 1;
25  
26 =pod
27  
28 =head1 NAME
29  
30 UR::BoolExpr::Template::PropertyComparison::Matches - perform a Perl regular expression match
31  
32 =head1 DESCRIPTION
33  
34 If the property returns multiple values, this comparison returns true if any of the values match
35  
36 =cut