~ubuntu-branches/debian/wheezy/eperl/wheezy

« back to all changes in this revision

Viewing changes to t/05-mode_nphcgi.t

  • Committer: Bazaar Package Importer
  • Author(s): Denis Barbier
  • Date: 2001-12-18 20:40:24 UTC
  • Revision ID: james.westby@ubuntu.com-20011218204024-k0oaqq2eaw733v30
Tags: 2.2.14-4
* Remove emacs crap from debian/changelog
* Fix misspelling in debian/copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
);
14
14
 
15
15
$testfile1b = &TEST::tmpfile(<<"EOT"
16
 
HTTP/1.0 200 OK
17
 
Server: XXXX
18
 
Date: XXXX
19
 
Connection: close
20
 
Content-Type: text/html
21
 
Content-Length: 27
22
 
 
 
16
HTTP/1.0 200 OK\r
 
17
Server: XXXX\r
 
18
Date: XXXX\r
 
19
Connection: close\r
 
20
Content-Type: text/html\r
 
21
Content-Length: 27\r
 
22
\r
23
23
some stuff
24
24
some more stuff
25
25
EOT
31
31
EOT
32
32
);
33
33
$testfile3 = &TEST::tmpfile(<<"EOT"
34
 
HTTP/1.0 200 OK
35
 
Server: XXXX
36
 
Date: XXXX
37
 
Connection: close
38
 
Content-Type: text/html
39
 
Content-Length: 35
40
 
 
 
34
HTTP/1.0 200 OK\r
 
35
Server: XXXX\r
 
36
Date: XXXX\r
 
37
Connection: close\r
 
38
Content-Type: text/html\r
 
39
Content-Length: 35\r
 
40
\r
41
41
some stuff
42
42
foo bar
43
43
some more stuff
46
46
 
47
47
#   test for working forced NPH-CGI mode
48
48
$tempfile1 = &TEST::tmpfile;
49
 
$rc = &TEST::system("../eperl -m n $testfile1 | sed -e 's/^Server:.*/Server: XXXX/' -e 's/^Date:.*/Date: XXXX/' >$tempfile1");
 
49
$rc = &TEST::system("../eperl -m n $testfile1 | sed -e 's/^Server:.*
 
 
b'/Server: XXXX'
 
 
b"/' -e 's/^Date:.*"
 
 
b'/Date: XXXX'
 
 
b'/\' >$tempfile1");'
50
50
print ($rc == 0 ? "ok\n" : "not ok\n");
51
51
$rc = &TEST::system("cmp $testfile1b $tempfile1");
52
52
print ($rc == 0 ? "ok\n" : "not ok\n");
53
53
 
54
54
#   test for working implicit CGI mode
55
55
$tempfile2 = &TEST::tmpfile;
56
 
$rc = &TEST::system("PATH_TRANSLATED=$testfile1; export PATH_TRANSLATED; GATEWAY_INTERFACE=CGI/1.1; export GATEWAY_INTERFACE; ../eperl -m n | sed -e 's/^Server:.*/Server: XXXX/' -e 's/^Date:.*/Date: XXXX/' >$tempfile2");
 
56
$rc = &TEST::system("PATH_TRANSLATED=$testfile1; export PATH_TRANSLATED; GATEWAY_INTERFACE=CGI/1.1; export GATEWAY_INTERFACE; ../eperl -m n | sed -e 's/^Server:.*
 
 
b'/Server: XXXX'
 
 
b"/' -e 's/^Date:.*"
 
 
b'/Date: XXXX'
 
 
b'/\' >$tempfile2");'
57
57
print ($rc == 0 ? "ok\n" : "not ok\n");
58
58
$rc = &TEST::system("cmp $testfile1b $tempfile2");
59
59
print ($rc == 0 ? "ok\n" : "not ok\n");
64
64
 
65
65
#   test if filter mode actually works for embedded Perl 5 blocks
66
66
$tempfile3 = &TEST::tmpfile;
67
 
&TEST::system("../eperl -m n $testfile2 | sed -e 's/^Server:.*/Server: XXXX/' -e 's/^Date:.*/Date: XXXX/' >$tempfile3");
 
67
&TEST::system("../eperl -m n $testfile2 | sed -e 's/^Server:.*
 
 
b'/Server: XXXX'
 
 
b"/' -e 's/^Date:.*"
 
 
b'/Date: XXXX'
 
 
b'/\' >$tempfile3");'
68
68
$rc = &TEST::system("cmp $tempfile3 $testfile3");
69
69
print ($rc == 0 ? "ok\n" : "not ok\n");
70
70