Added missing changes
[catagits/HTTP-Body.git] / t / 04multipart.t
index bce0f85..074ca10 100644 (file)
@@ -3,14 +3,17 @@
 use strict;
 use warnings;
 
-use Test::More tests => 140;
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Test::More tests => 153;
 use Test::Deep;
 
 use Cwd;
 use HTTP::Body;
 use File::Spec::Functions;
 use IO::File;
-use YAML;
+use PAML;
 use File::Temp qw/ tempdir /;
 
 my $path = catdir( getcwd(), 't', 'data', 'multipart' );
@@ -18,8 +21,8 @@ my $path = catdir( getcwd(), 't', 'data', 'multipart' );
 for ( my $i = 1; $i <= 13; $i++ ) {
 
     my $test    = sprintf( "%.3d", $i );
-    my $headers = YAML::LoadFile( catfile( $path, "$test-headers.yml" ) );
-    my $results = YAML::LoadFile( catfile( $path, "$test-results.yml" ) );
+    my $headers = PAML::LoadFile( catfile( $path, "$test-headers.pml" ) );
+    my $results = PAML::LoadFile( catfile( $path, "$test-results.pml" ) );
     my $content = IO::File->new( catfile( $path, "$test-content.dat" ) );
     my $body    = HTTP::Body->new( $headers->{'Content-Type'}, $headers->{'Content-Length'} );
     my $tempdir = tempdir( 'XXXXXXX', CLEANUP => 1, DIR => File::Spec->tmpdir() );
@@ -60,9 +63,10 @@ for ( my $i = 1; $i <= 13; $i++ ) {
             $results->{upload}->{$field}->{tempname} = ignore();
         }
     }
-
+       
     cmp_deeply( $body->body, $results->{body}, "$test MultiPart body" );
     cmp_deeply( $body->param, $results->{param}, "$test MultiPart param" );
+    cmp_deeply( $body->param_order, $results->{param_order} ? $results->{param_order} : [], "$test MultiPart param_order" );
     cmp_deeply( $body->upload, $results->{upload}, "$test MultiPart upload" )
         if $results->{upload};
     cmp_ok( $body->state, 'eq', 'done', "$test MultiPart state" );
@@ -79,4 +83,5 @@ for ( my $i = 1; $i <= 13; $i++ ) {
     for my $temp ( @temps ) {
         ok( !-e $temp, "Temp file $temp was deleted" );
     }
+
 }