| blib/lib/WWW/Shopify/Liquid/Filter/Slice.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 9 | 12 | 75.0 |
| branch | 0 | 2 | 0.0 |
| condition | n/a | ||
| subroutine | 3 | 4 | 75.0 |
| pod | 0 | 1 | 0.0 |
| total | 12 | 19 | 63.1 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | #!/usr/bin/perl | ||||||
| 2 | 37 | 37 | 21435 | use strict; | |||
| 37 | 119 | ||||||
| 37 | 1375 | ||||||
| 3 | 37 | 37 | 329 | use warnings; | |||
| 37 | 111 | ||||||
| 37 | 1959 | ||||||
| 4 | |||||||
| 5 | 37 | 37 | 277 | package WWW::Shopify::Liquid::Filter::Slice; use base 'WWW::Shopify::Liquid::Filter'; | |||
| 37 | 108 | ||||||
| 37 | 7798 | ||||||
| 6 | |||||||
| 7 | sub operate { | ||||||
| 8 | 0 | 0 | 0 | my ($self, $hash, $operand, $index, $length) = @_; | |||
| 9 | 0 | 0 | $length = 1 unless defined $length; | ||||
| 10 | 0 | return substr($operand, $index, $length); | |||||
| 11 | } | ||||||
| 12 | |||||||
| 13 | 1; |