~ubuntu-branches/ubuntu/precise/perl/precise

« back to all changes in this revision

Viewing changes to cpan/CGI/t/multipart_init.t

  • Committer: Bazaar Package Importer
  • Author(s): Niko Tyni
  • Date: 2011-02-06 11:31:38 UTC
  • mto: (8.2.12 experimental) (1.1.12)
  • mto: This revision was merged to the branch mainline in revision 46.
  • Revision ID: james.westby@ubuntu.com-20110206113138-lzpm3g6rur7i3eyp
Tags: upstream-5.12.3
ImportĀ upstreamĀ versionĀ 5.12.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use Test::More 'no_plan';
 
2
 
 
3
use CGI;
 
4
 
 
5
my $q = CGI->new;
 
6
 
 
7
my $sv = $q->multipart_init;
 
8
like( $sv, qr|Content-Type: multipart/x-mixed-replace;boundary="------- =|, 'multipart_init(), basic');
 
9
 
 
10
like( $sv, qr/$CGI::CRLF$/, 'multipart_init(), ends in CRLF' );
 
11
 
 
12
$sv = $q->multipart_init( 'this_is_the_boundary' );
 
13
like( $sv, qr/boundary="this_is_the_boundary"/, 'multipart_init("simple_boundary")' );
 
14
$sv = $q->multipart_init( -boundary => 'this_is_another_boundary' );
 
15
like($sv,
 
16
     qr/boundary="this_is_another_boundary"/, "multipart_init( -boundary => 'this_is_another_boundary')");
 
17
 
 
18
$sv = $q->multipart_init;
 
19
my $sv2 = $q->multipart_init;
 
20
isnt($sv,$sv2,"due to random boundaries, multiple calls produce different results");