File: multipart_start.t

package info (click to toggle)
libcgi-pm-perl 4.68-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,028 kB
  • sloc: perl: 6,082; makefile: 9
file content (34 lines) | stat: -rw-r--r-- 719 bytes parent folder | download | duplicates (6)
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'
);