Project

General

Profile

Bug #222 ยป 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
use strict;
use IO::Socket;
use Test::More tests => 4;
use Test::More tests => 7;
use LightyTest;
my $tf = LightyTest->new();
......
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "2\n\n" } ];
ok($tf->handle_http($t) == 0, 'ssi - echo ');
$t->{REQUEST} = ( <<EOF
GET /include.shtml HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "include\n12345\n\n" } ];
ok($tf->handle_http($t) == 0, 'ssi - include static content, filesystem-relative path');
$t->{REQUEST} = ( <<EOF
GET /include-virtual.shtml HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "include-virtual\n12345\n\n" } ];
ok($tf->handle_http($t) == 0, 'ssi - include static content, URL (virtual) path');
## bug #222
$t->{REQUEST} = ( <<EOF
GET /include-virtual-cgi.shtml HTTP/1.0
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "include-virtual-cgi\n/cgi.pl\n\n" } ];
ok($tf->handle_http($t) == 0, 'ssi - include virtual CGI ');
ok($tf->stop_proc == 0, "Stopping lighttpd");
lighttpd-1.4.9/tests/docroot/www/include.shtml 2006-02-10 12:38:07.000000000 +0100
include
<!--#include file="range.pdf" -->
lighttpd-1.4.9/tests/docroot/www/include-virtual-cgi.shtml 2006-02-10 12:13:41.000000000 +0100
include-virtual-cgi
<!--#include virtual="cgi.pl" -->
lighttpd-1.4.9/tests/docroot/www/include-virtual.shtml 2006-02-10 12:38:16.000000000 +0100
include-virtual
<!--#include virtual="/range.pdf" -->
    (1-1/1)