File Coverage

blib/lib/WWW/Shopify/Liquid/Operator/NotRegex.pm
Criterion Covered Total %
statement 9 17 52.9
branch 0 6 0.0
condition 0 6 0.0
subroutine 3 6 50.0
pod 0 3 0.0
total 12 38 31.5


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 30     30   15749 use strict;
  30         51  
  30         984  
3 30     30   136 use warnings;
  30         111  
  30         1104  
4              
5             # So sick of crap.
6             package WWW::Shopify::Liquid::Operator::NotRegex;
7 30     30   124 use base 'WWW::Shopify::Liquid::Operator';
  30         43  
  30         5345  
8 0     0 0   sub symbol { return '!~'; }
9 0     0 0   sub priority { return 5; }
10             sub operate {
11 0     0 0   my ($self, $hash, $action, $op1, $op2) = @_;
12 0 0 0       return 1 if !defined $op1 && defined $op2;
13 0 0 0       return undef unless defined $op1 && defined $op2;
14 0           my @groups = ($op1 !~ m/$op2/);
15 0 0         return undef if (int(@groups) == 0);
16 0           return \@groups;
17             }
18              
19             1;