File Coverage

blib/lib/WWW/Shopify/Liquid/Operator/Assignment.pm
Criterion Covered Total %
statement 12 21 57.1
branch n/a
condition n/a
subroutine 4 9 44.4
pod 0 4 0.0
total 16 34 47.0


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 30     30   16939 use strict;
  30         54  
  30         957  
3 30     30   132 use warnings;
  30         60  
  30         1102  
4              
5             package WWW::Shopify::Liquid::Operator::Assignment;
6 30     30   132 use base 'WWW::Shopify::Liquid::Operator';
  30         54  
  30         2329  
7 30     30   168 use List::Util qw(first);
  30         40  
  30         7270  
8 0     0 0   sub symbol { return '='; }
9 0     0 0   sub priority { return 1; }
10             # Can't optimize this away; it's generally necessary for assignment tags, so we just assume taht this is always going to be there.
11              
12             sub optimize {
13 0     0 0   my ($self, $optimizer) = (shift, shift);
14 0           $self->SUPER::optimize($self, $optimizer, @_);
15 0           print STDERR "A\n";
16 0           return $self;
17             }
18              
19             sub operate {
20 0     0 0   return first { ($_ cmp $_[4]) == 0 } ref($_[3]) eq "ARRAY";
  0     0      
21 0           return index($_[3], $_[4]) != -1;
22             }
23              
24             1;