aboutsummaryrefslogtreecommitdiff
path: root/t/basic.t
blob: 0494ff0b08bf8700bc8ec3c770c5e9c6c5ba7a86 (plain)
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
use strict;
use warnings FATAL => 'all';

use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest qw/GET_BODY/;

plan tests => 1;

# (0) Prepare environment

# - Read contents of header and footer
open my $h, '<', 't/htdocs/head.html' or die;
open my $f, '<', 't/htdocs/foot.html' or die;
chomp(my $head = do { local $/; <$h> });
chomp(my $foot = do { local $/; <$f> });
close $h; close $f;

# - Open test file for writing
open my $t, '>', 't/htdocs/test.html' or die;
my $test;

# (1) <head>-less head

$test = <<END;
<title>Test</title>
This is a test page.
END
seek($t, 0, 0);
print $t $test;

ok GET_BODY('/test.html'), <<END, '<head>-less head';
<title>Test</title>
$head
This is a test page.
$foot
END

close $t;