summaryrefslogtreecommitdiff
path: root/t/headers/charset.t
diff options
context:
space:
mode:
Diffstat (limited to 't/headers/charset.t')
-rw-r--r--t/headers/charset.t20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/headers/charset.t b/t/headers/charset.t
new file mode 100644
index 0000000..500bd9b
--- /dev/null
+++ b/t/headers/charset.t
@@ -0,0 +1,20 @@
+use strict;
+use CGI;
+use Test::More;
+
+{
+ my $cgi = CGI->new;
+ my $got = $cgi->header( -charset => 'utf-8' );
+ my $expected = 'Content-Type: text/html; charset=utf-8'
+ . $CGI::CRLF x 2;
+ is $got, $expected, 'charset';
+}
+
+{
+ my $cgi = CGI->new;
+ my $got = $cgi->header( -charset => q{} );
+ my $expected = 'Content-Type: text/html' . $CGI::CRLF x 2;
+ is $got, $expected, 'charset empty string';
+}
+
+done_testing;