1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 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'
);
|