File: Test.pm

package info (click to toggle)
libapache-asp-perl 2.63-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 4,120 kB
  • sloc: perl: 6,044; php: 409; sh: 62; lisp: 22; makefile: 10
file content (39 lines) | stat: -rw-r--r-- 645 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package Apache::ASP::CGI::Test;

use Apache::ASP::CGI;
@ISA = qw(Apache::ASP::CGI);

use strict;

sub init {
    my $self = shift->SUPER::init(@_);
    $self->OUT('');
    $self;
}

sub print {
    my $self = shift;
    my $data = join('', map { ref($_) =~ /SCALAR/ ? $$_ : $_; } @_);
    my $out = $self->OUT || '';
    $self->OUT($out.$data);
}

sub test_header_out {
    (shift->test_parse_out)[0];
}

sub test_body_out {
    (shift->test_parse_out)[1];
}

sub test_parse_out {
    my $self = shift;
    my $out = $self->OUT;
    if($out =~ /^(.*?)\s*\n\s*\n\s*(.*)$/s) {
	my($header, $body) = ($1, $2);
    } else {
	($out, '');
    }
}

1;