File Coverage

blib/lib/WWW/Shopify/Liquid/Operator/Minus.pm
Criterion Covered Total %
statement 14 14 100.0
branch 2 4 50.0
condition 4 12 33.3
subroutine 6 6 100.0
pod 0 3 0.0
total 26 39 66.6


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 21     21   10857 use strict;
  21         38  
  21         730  
3 21     21   101 use warnings;
  21         30  
  21         716  
4              
5             package WWW::Shopify::Liquid::Operator::Minus;
6 21     21   96 use base 'WWW::Shopify::Liquid::Operator';
  21         30  
  21         4061  
7 293     293 0 713 sub symbol { return '-'; }
8 1288     1288 0 2237 sub priority { return 9; }
9             sub operate {
10 1 50 33 1 0 10 $_[3] = $_[3]->epoch if ($_[3] && ref($_[3]) && ref($_[3]) eq 'DateTime');
      33        
11 1 50 33     13 $_[4] = $_[4]->epoch if ($_[4] && ref($_[4]) && ref($_[4]) eq 'DateTime');
      33        
12 1         14 return $_[0]->ensure_numerical($_[3]) - $_[0]->ensure_numerical($_[4]); }
13              
14             1;