File Coverage

blib/lib/WWW/Shopify/Liquid/Operator/Regex.pm
Criterion Covered Total %
statement 9 16 56.2
branch 0 4 0.0
condition 0 3 0.0
subroutine 3 6 50.0
pod 0 3 0.0
total 12 32 37.5


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 30     30   16754 use strict;
  30         60  
  30         904  
3 30     30   132 use warnings;
  30         49  
  30         1083  
4              
5             # So sick of crap.
6             package WWW::Shopify::Liquid::Operator::Regex;
7 30     30   150 use base 'WWW::Shopify::Liquid::Operator';
  30         43  
  30         5585  
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 undef unless defined $op1 && defined $op2;
13 0           my @groups = ($op1 =~ m/$op2/);
14 0 0         return undef if (int(@groups) == 0);
15 0           return \@groups;
16             }
17              
18             1;