File Coverage

blib/lib/WWW/Shopify/Liquid/Operator/Array.pm
Criterion Covered Total %
statement 21 21 100.0
branch 1 2 50.0
condition 3 9 33.3
subroutine 9 9 100.0
pod 0 4 0.0
total 34 45 75.5


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 37     37   15166 use strict;
  37         104  
  37         1135  
3 37     37   237 use warnings;
  37         88  
  37         1557  
4              
5             package WWW::Shopify::Liquid::Operator::Array;
6 37     37   243 use base 'WWW::Shopify::Liquid::Operator';
  37         97  
  37         3896  
7 37     37   284 use List::Util qw(first);
  37         106  
  37         2686  
8 37     37   260 use Scalar::Util qw(looks_like_number);
  37         106  
  37         6892  
9 1318     1318 0 4470 sub symbol { return '..'; }
10 10795     10795 0 23266 sub priority { return 7; }
11             sub operate {
12 24     24 0 91 my ($self, $hash, $type, $op1, $op2) = @_;
13 24 50 33     310 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);
      33        
      33        
14 24         193 return [$op1..$op2];
15             }
16 1     1 0 12 sub requires_grouping { return 1; }
17              
18             1;