lib/Spreadsheet/Engine/Function/MAX.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 13 | 13 | 100.0 |
branch | 4 | 4 | 100.0 |
condition | n/a | ||
subroutine | 5 | 5 | 100.0 |
pod | 1 | 1 | 100.0 |
total | 23 | 23 | 100.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Spreadsheet::Engine::Function::MAX; | ||||||
2 | |||||||
3 | 28 | 28 | 153 | use strict; | |||
28 | 62 | ||||||
28 | 982 | ||||||
4 | 28 | 28 | 148 | use warnings; | |||
28 | 55 | ||||||
28 | 855 | ||||||
5 | |||||||
6 | 28 | 28 | 141 | use base 'Spreadsheet::Engine::Fn::series'; | |||
28 | 54 | ||||||
28 | 4911 | ||||||
7 | |||||||
8 | sub calculate { | ||||||
9 | return sub { | ||||||
10 | 537 | 537 | 988 | my ($in, $max) = @_; | |||
11 | 537 | 100 | 5865 | return $in->value if not defined $max; | |||
12 | 320 | 100 | 6584 | return ($in->value > $max) ? $in->value : $max; | |||
13 | 241 | 241 | 1 | 1722 | }; | ||
14 | } | ||||||
15 | |||||||
16 | 1; | ||||||
17 | |||||||
18 | __END__ |