File Coverage

blib/lib/Apache/Session/Browseable/_common.pm
Criterion Covered Total %
statement 41 42 97.6
branch 12 14 85.7
condition 2 3 66.6
subroutine 8 8 100.0
pod 0 2 0.0
total 63 69 91.3


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