File Coverage

lib/Spreadsheet/Engine/Function/AND.pm
Criterion Covered Total %
statement 20 20 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod 2 2 100.0
total 31 31 100.0


line stmt bran cond sub pod time code
1             package Spreadsheet::Engine::Function::AND;
2              
3 28     28   155 use strict;
  28         56  
  28         1944  
4 28     28   151 use warnings;
  28         61  
  28         738  
5              
6 28     28   431 use base 'Spreadsheet::Engine::Fn::logical';
  28         131  
  28         3602  
7 28     28   177 use List::Util 'first';
  28         58  
  28         6780  
8              
9 342     342 1 719 sub argument_count { -1 }
10              
11             sub calculate {
12 342     342 1 452 my $self = shift;
13 342         616 my @ops = map $self->next_operand, 1 .. @{ $self->foperand };
  342         850  
14 342         8581 my $type = $self->optype(propagateerror => @ops);
15 342 100       7626 die $type if $type->is_error;
16 304     490   4554 return not(first { not $_->value } @ops);
  490         10437  
17             }
18              
19             1;
20              
21             __END__