summaryrefslogtreecommitdiff
path: root/t/multipart_start.t
diff options
context:
space:
mode:
Diffstat (limited to 't/multipart_start.t')
-rw-r--r--t/multipart_start.t34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/multipart_start.t b/t/multipart_start.t
new file mode 100644
index 0000000..42ade75
--- /dev/null
+++ b/t/multipart_start.t
@@ -0,0 +1,34 @@
+#!perl
+
+use strict;
+use warnings;
+use Test::More 'no_plan';
+
+use CGI;
+
+my $q = CGI->new;
+my $CRLF = $MultipartBuffer::CRLF;
+
+like(
+ $q->multipart_start,
+ qr!^Content-Type: text/html$CRLF$CRLF$!,
+ 'multipart_start with no args'
+);
+
+like(
+ $q->multipart_start( -type => 'text/plain' ),
+ qr!^Content-Type: text/plain$CRLF$CRLF$!,
+ 'multipart_start with type'
+);
+
+like(
+ $q->multipart_start( -charset => 'utf-8' ),
+ qr!^Content-Type: text/html; charset=utf-8$CRLF$CRLF$!,
+ 'multipart_start with charset'
+);
+
+like(
+ $q->multipart_start( -type => 'text/plain', -charset => 'utf-8' ),
+ qr!^Content-Type: text/plain; charset=utf-8$CRLF$CRLF$!,
+ 'multipart_start with type and charset'
+);