Project

General

Profile

lighttpd-mod-ssi-basic-tests.patch

Testcases for common include statements - conny, 2006-02-10 14:07

View differences:

lighttpd-1.4.9/tests/mod-ssi.t 2006-02-10 12:41:31.000000000 +0100
8 8

  
9 9
use strict;
10 10
use IO::Socket;
11
use Test::More tests => 4;
11
use Test::More tests => 7;
12 12
use LightyTest;
13 13

  
14 14
my $tf = LightyTest->new();
......
34 34
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "2\n\n" } ];
35 35
ok($tf->handle_http($t) == 0, 'ssi - echo ');
36 36

  
37
$t->{REQUEST}  = ( <<EOF
38
GET /include.shtml HTTP/1.0
39
EOF
40
 );
41
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "include\n12345\n\n" } ];
42
ok($tf->handle_http($t) == 0, 'ssi - include static content, filesystem-relative path');
43

  
44
$t->{REQUEST}  = ( <<EOF
45
GET /include-virtual.shtml HTTP/1.0
46
EOF
47
 );
48
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "include-virtual\n12345\n\n" } ];
49
ok($tf->handle_http($t) == 0, 'ssi - include static content, URL (virtual) path');
50

  
51
## bug #222
52
$t->{REQUEST}  = ( <<EOF
53
GET /include-virtual-cgi.shtml HTTP/1.0
54
EOF
55
 );
56
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "include-virtual-cgi\n/cgi.pl\n\n" } ];
57
ok($tf->handle_http($t) == 0, 'ssi - include virtual CGI ');
37 58

  
38 59
ok($tf->stop_proc == 0, "Stopping lighttpd");
39 60

  
lighttpd-1.4.9/tests/docroot/www/include.shtml 2006-02-10 12:38:07.000000000 +0100
1
include
2
<!--#include file="range.pdf" -->
lighttpd-1.4.9/tests/docroot/www/include-virtual-cgi.shtml 2006-02-10 12:13:41.000000000 +0100
1
include-virtual-cgi
2
<!--#include virtual="cgi.pl" -->
lighttpd-1.4.9/tests/docroot/www/include-virtual.shtml 2006-02-10 12:38:16.000000000 +0100
1
include-virtual
2
<!--#include virtual="/range.pdf" -->