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

filter: Statementstmt 0.0% 0 / 21 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 / 29 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::NotLike;
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 my $escape = '\\';
17 my $regex = $class->
18 comparison_value_and_escape_character_to_regex(
19 $comparison_value,
20 $escape
21 );
22 no warnings 'uninitialized';
23 foreach my $property_value ( @property_value ) {
24 return '' if ($property_value =~ $regex);
25 }
26 return 1;
27 }
28  
29 1;
30  
31 =pod
32  
33 =head1 NAME
34  
35 UR::BoolExpr::Template::PropertyComparison::NotLike - perform a negated SQL-ish like test
36  
37 =head1 DESCRIPTION
38  
39 The input test value is assummed to be an SQL 'like' value, where '_'
40 represents a one character wildcard, and '%' means a 0 or more character
41 wildcard. It gets converted to a perl regular expression and used in a
42 negated match against an object's properties
43  
44 If the property returns multiple values, this comparison returns false if
45 any of the values matches the pattern
46  
47 =cut
48