lib/Spreadsheet/Engine/Function/MID.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 15 | 15 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 6 | 6 | 100.0 |
pod | 2 | 2 | 100.0 |
total | 23 | 23 | 100.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Spreadsheet::Engine::Function::MID; | ||||||
2 | |||||||
3 | 28 | 28 | 151 | use strict; | |||
28 | 55 | ||||||
28 | 1083 | ||||||
4 | 28 | 28 | 151 | use warnings; | |||
28 | 57 | ||||||
28 | 747 | ||||||
5 | |||||||
6 | 28 | 28 | 181 | use base 'Spreadsheet::Engine::Fn::text'; | |||
28 | 56 | ||||||
28 | 4555 | ||||||
7 | |||||||
8 | 402 | 402 | 1 | 1764 | sub signature { 't', '>=1', '>=0' } | ||
9 | |||||||
10 | sub calculate { | ||||||
11 | 167 | 167 | 1 | 12528 | my ($self, $string, $start, $len) = @_; | ||
12 | 28 | 28 | 173 | no warnings 'substr'; | |||
28 | 69 | ||||||
28 | 2156 | ||||||
13 | 167 | 1276 | return substr($string, $start - 1, $len); | ||||
14 | } | ||||||
15 | |||||||
16 | 1; | ||||||
17 | |||||||
18 | __END__ |