File Coverage

blib/lib/WWW/Shopify/Liquid/Operator/NotEquals.pm
Criterion Covered Total %
statement 14 18 77.7
branch 0 4 0.0
condition 0 12 0.0
subroutine 6 7 85.7
pod 0 3 0.0
total 20 44 45.4


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 21     21   10768 use strict;
  21         43  
  21         803  
3 21     21   99 use warnings;
  21         32  
  21         747  
4              
5             package WWW::Shopify::Liquid::Operator::NotEquals;
6 21     21   101 use base 'WWW::Shopify::Liquid::Operator';
  21         31  
  21         2233  
7 291     291 0 775 sub symbol { return '!='; }
8 115     115 0 182 sub priority { return 5; }
9 21     21   124 use Data::Compare;
  21         36  
  21         193  
10             sub operate {
11 0     0 0   my ($self, $hash, $action, $op1, $op2) = @_;
12 0 0 0       return $op1 != $op2 if (ref($op1) && ref($op2) && ref($op1) eq "DateTime" && ref($op2) eq "DateTime");
      0        
      0        
13 0 0 0       return !Compare($op1, $op2) if (ref($op1) && ref($op2));
14 0           return ($op1 cmp $op2) != 0;
15             }
16             1;