File Coverage

blib/lib/WWW/Shopify/Liquid/Operator/Array.pm
Criterion Covered Total %
statement 15 21 71.4
branch 0 2 0.0
condition 0 9 0.0
subroutine 5 9 55.5
pod 0 4 0.0
total 20 45 44.4


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 30     30   15119 use strict;
  30         62  
  30         901  
3 30     30   121 use warnings;
  30         54  
  30         1109  
4              
5             package WWW::Shopify::Liquid::Operator::Array;
6 30     30   123 use base 'WWW::Shopify::Liquid::Operator';
  30         40  
  30         2099  
7 30     30   161 use List::Util qw(first);
  30         54  
  30         2065  
8 30     30   147 use Scalar::Util qw(looks_like_number);
  30         42  
  30         4974  
9 0     0 0   sub symbol { return '..'; }
10 0     0 0   sub priority { return 7; }
11             sub operate {
12 0     0 0   my ($self, $hash, $type, $op1, $op2) = @_;
13 0 0 0       die new WWW::Shopify::Liquid::Exception::Renderer::Arguments($self, "Both operands must be integers.") unless defined $op1 && defined $op2 && looks_like_number($op1) && looks_like_number($op2);
      0        
      0        
14 0           return [$op1..$op2];
15             }
16 0     0 0   sub requires_grouping { return 1; }
17              
18             1;