diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-16 06:44:29 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-16 06:44:29 +0000 |
commit | f9f3ab3056d94292adb4ab2e1451645bee989769 (patch) | |
tree | cc5a62954d359d5aad449420bc7ec259b3edb79e /t/headers/p3p.t | |
download | CGI-tarball-f9f3ab3056d94292adb4ab2e1451645bee989769.tar.gz |
Diffstat (limited to 't/headers/p3p.t')
-rw-r--r-- | t/headers/p3p.t | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/t/headers/p3p.t b/t/headers/p3p.t new file mode 100644 index 0000000..e10c073 --- /dev/null +++ b/t/headers/p3p.t @@ -0,0 +1,33 @@ +use strict; +use CGI; +use Test::More; + +{ + my $cgi = CGI->new; + my $got = $cgi->header( -p3p => "CAO DSP LAW CURa" ); + my $expected = 'P3P: policyref="/w3c/p3p.xml", CP="CAO DSP LAW CURa"' + . $CGI::CRLF + . 'Content-Type: text/html; charset=ISO-8859-1' + . $CGI::CRLF x 2; + is $got, $expected, 'p3p'; +} + +{ + my $cgi = CGI->new; + my $got = $cgi->header( -p3p => [ qw/CAO DSP LAW CURa/ ] ); + my $expected = 'P3P: policyref="/w3c/p3p.xml", CP="CAO DSP LAW CURa"' + . $CGI::CRLF + . 'Content-Type: text/html; charset=ISO-8859-1' + . $CGI::CRLF x 2; + is $got, $expected, 'p3p arrayref'; +} + +{ + my $cgi = CGI->new; + my $got = $cgi->header( -p3p => q{} ); + my $expected = 'Content-Type: text/html; charset=ISO-8859-1' + . $CGI::CRLF x 2; + is $got, $expected, 'p3p empty string'; +} + +done_testing; |