File Coverage

blib/lib/WWW/Shopify/Liquid/Filter/Truncatewords.pm
Criterion Covered Total %
statement 9 13 69.2
branch n/a
condition n/a
subroutine 3 6 50.0
pod 0 3 0.0
total 12 22 54.5


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 21     21   10358 use strict;
  21         38  
  21         775  
3 21     21   102 use warnings;
  21         35  
  21         810  
4              
5 21     21   95 package WWW::Shopify::Liquid::Filter::Truncatewords; use base 'WWW::Shopify::Liquid::Filter';
  21         29  
  21         3355  
6 0     0 0   sub max_arguments { return 1; }
7 0     0 0   sub min_arguments { return 1; }
8 0     0 0   sub operate { my @words = split(/\s+/, $_[2]); return join(" ", @words[0..(int($_[3])-1)]); }
  0            
9              
10             1;