File Coverage

blib/lib/Apache/ASP/CGI/Test.pm
Criterion Covered Total %
statement 20 21 95.2
branch 2 4 50.0
condition 2 2 100.0
subroutine 7 7 100.0
pod 0 5 0.0
total 31 39 79.5


line stmt bran cond sub pod time code
1             package Apache::ASP::CGI::Test;
2              
3 3     3   115 use Apache::ASP::CGI;
  3         32  
  3         72  
4             @ISA = qw(Apache::ASP::CGI);
5              
6 3     3   66 use strict;
  3         29  
  3         45  
7              
8             sub init {
9 8     8 0 1622     my $self = shift->SUPER::init(@_);
10 8         188     $self->OUT('');
11 8         92     $self;
12             }
13              
14             sub print {
15 15     15 0 137     my $self = shift;
16 15 50       158     my $data = join('', map { ref($_) =~ /SCALAR/ ? $$_ : $_; } @_);
  15         193  
17 15   100     200     my $out = $self->OUT || '';
18 15         733     $self->OUT($out.$data);
19             }
20              
21             sub test_header_out {
22 5     5 0 109     (shift->test_parse_out)[0];
23             }
24              
25             sub test_body_out {
26 8     8 0 176     (shift->test_parse_out)[1];
27             }
28              
29             sub test_parse_out {
30 13     13 0 145     my $self = shift;
31 13         227     my $out = $self->OUT;
32 13 50       391     if($out =~ /^(.*?)\s*\n\s*\n\s*(.*)$/s) {
33 13         280 my($header, $body) = ($1, $2);
34                 } else {
35 0           ($out, '');
36                 }
37             }
38              
39             1;
40