diff options
Diffstat (limited to 't/headers/nph.t')
-rw-r--r-- | t/headers/nph.t | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/t/headers/nph.t b/t/headers/nph.t new file mode 100644 index 0000000..5d0e5e7 --- /dev/null +++ b/t/headers/nph.t @@ -0,0 +1,24 @@ +use strict; +use CGI; +use Test::More; + +{ + my $cgi = CGI->new; + my $got = $cgi->header( -nph => 1 ); + my $expected = "^HTTP/1.0 200 OK$CGI::CRLF" + . "Server: cmdline$CGI::CRLF" + . "Date: [^$CGI::CRLF]+$CGI::CRLF" + . 'Content-Type: text/html; charset=ISO-8859-1' + . $CGI::CRLF x 2; + like $got, qr($expected), 'nph'; +} + +{ + my $cgi = CGI->new; + my $got = $cgi->header( -nph => 0 ); + my $expected = 'Content-Type: text/html; charset=ISO-8859-1' + . $CGI::CRLF x 2; + is $got, $expected, 'nph'; +} + +done_testing; |