File Coverage

blib/lib/Apache/Session/Browseable/_common.pm
Criterion Covered Total %
statement 40 42 95.2
branch 11 14 78.5
condition 2 3 66.6
subroutine 8 8 100.0
pod 0 2 0.0
total 61 69 88.4


line stmt bran cond sub pod time code
1             package Apache::Session::Browseable::_common;
2              
3 5     5   673 use strict;
  5         6  
  5         170  
4 5     5   3282 use AutoLoader 'AUTOLOAD';
  5         6711  
  5         30  
5              
6             our $VERSION = '1.0';
7              
8             sub _tabInTab {
9 9     9   544 my ( $class, $t1, $t2 ) = @_;
10              
11             # if no fields are required, return 0
12 9 100 66     53 return 0 unless(@$t1 and @$t2);
13 6         14 foreach my $f (@$t1) {
14 15 100       17 unless ( grep { $_ eq $f } @$t2 ) {
  40         75  
15 3         14 return 0;
16             }
17             }
18 3         11 return 1;
19             }
20              
21             sub _fieldIsIndexed {
22 8     8   13 my ( $class, $args, $field ) = @_;
23 8 50       47 my $index =
24             ref( $args->{Index} ) ? $args->{Index} : [ split /\s+/, $args->{Index} ];
25 8         16 return ( grep { $_ eq $field } @$index );
  16         54  
26             }
27              
28             1;
29             __END__