Dropped YAML, we now use PAML, "PAML Ain't Markup Language"
Christian Hansen [Sat, 9 Jan 2010 14:17:56 +0000 (14:17 +0000)]
106 files changed:
Changes
META.yml [deleted file]
Makefile.PL
scripts/benchmark.pl
scripts/stress.pl
t/04multipart.t
t/05urlencoded.t
t/06octetstream.t
t/07xforms.t
t/data/benchmark/001-headers.pml [new file with mode: 0644]
t/data/benchmark/001-headers.yml [deleted file]
t/data/benchmark/002-headers.pml [new file with mode: 0644]
t/data/benchmark/002-headers.yml [deleted file]
t/data/benchmark/003-headers.pml [new file with mode: 0644]
t/data/benchmark/003-headers.yml [deleted file]
t/data/multipart/001-headers.pml [new file with mode: 0644]
t/data/multipart/001-headers.yml [deleted file]
t/data/multipart/001-results.pml [new file with mode: 0644]
t/data/multipart/001-results.yml [deleted file]
t/data/multipart/002-headers.pml [new file with mode: 0644]
t/data/multipart/002-headers.yml [deleted file]
t/data/multipart/002-results.pml [new file with mode: 0644]
t/data/multipart/002-results.yml [deleted file]
t/data/multipart/003-headers.pml [new file with mode: 0644]
t/data/multipart/003-headers.yml [deleted file]
t/data/multipart/003-results.pml [new file with mode: 0644]
t/data/multipart/003-results.yml [deleted file]
t/data/multipart/004-headers.pml [new file with mode: 0644]
t/data/multipart/004-headers.yml [deleted file]
t/data/multipart/004-results.pml [new file with mode: 0644]
t/data/multipart/004-results.yml [deleted file]
t/data/multipart/005-headers.pml [new file with mode: 0644]
t/data/multipart/005-headers.yml [deleted file]
t/data/multipart/005-results.pml [new file with mode: 0644]
t/data/multipart/005-results.yml [deleted file]
t/data/multipart/006-headers.pml [new file with mode: 0644]
t/data/multipart/006-headers.yml [deleted file]
t/data/multipart/006-results.pml [new file with mode: 0644]
t/data/multipart/006-results.yml [deleted file]
t/data/multipart/007-headers.pml [new file with mode: 0644]
t/data/multipart/007-headers.yml [deleted file]
t/data/multipart/007-results.pml [new file with mode: 0644]
t/data/multipart/007-results.yml [deleted file]
t/data/multipart/008-headers.pml [new file with mode: 0644]
t/data/multipart/008-headers.yml [deleted file]
t/data/multipart/008-results.pml [new file with mode: 0644]
t/data/multipart/008-results.yml [deleted file]
t/data/multipart/009-headers.pml [new file with mode: 0644]
t/data/multipart/009-headers.yml [deleted file]
t/data/multipart/009-results.pml [new file with mode: 0644]
t/data/multipart/009-results.yml [deleted file]
t/data/multipart/010-headers.pml [new file with mode: 0644]
t/data/multipart/010-headers.yml [deleted file]
t/data/multipart/010-results.pml [new file with mode: 0644]
t/data/multipart/010-results.yml [deleted file]
t/data/multipart/011-headers.pml [new file with mode: 0644]
t/data/multipart/011-headers.yml [deleted file]
t/data/multipart/011-results.pml [new file with mode: 0644]
t/data/multipart/011-results.yml [deleted file]
t/data/multipart/012-headers.pml [new file with mode: 0644]
t/data/multipart/012-headers.yml [deleted file]
t/data/multipart/012-results.pml [new file with mode: 0644]
t/data/multipart/012-results.yml [deleted file]
t/data/multipart/013-headers.pml [new file with mode: 0644]
t/data/multipart/013-headers.yml [deleted file]
t/data/multipart/013-results.pml [new file with mode: 0644]
t/data/multipart/013-results.yml [deleted file]
t/data/octetstream/001-headers.pml [new file with mode: 0644]
t/data/octetstream/001-headers.yml [deleted file]
t/data/octetstream/002-headers.pml [new file with mode: 0644]
t/data/octetstream/002-headers.yml [deleted file]
t/data/octetstream/003-headers.pml [new file with mode: 0644]
t/data/octetstream/003-headers.yml [deleted file]
t/data/urlencoded/001-headers.pml [new file with mode: 0644]
t/data/urlencoded/001-headers.yml [deleted file]
t/data/urlencoded/001-results.pml [new file with mode: 0644]
t/data/urlencoded/001-results.yml [deleted file]
t/data/urlencoded/002-headers.pml [new file with mode: 0644]
t/data/urlencoded/002-headers.yml [deleted file]
t/data/urlencoded/002-results.pml [new file with mode: 0644]
t/data/urlencoded/002-results.yml [deleted file]
t/data/urlencoded/003-headers.pml [new file with mode: 0644]
t/data/urlencoded/003-headers.yml [deleted file]
t/data/urlencoded/003-results.pml [new file with mode: 0644]
t/data/urlencoded/003-results.yml [deleted file]
t/data/urlencoded/004-headers.pml [new file with mode: 0644]
t/data/urlencoded/004-headers.yml [deleted file]
t/data/urlencoded/004-results.pml [new file with mode: 0644]
t/data/urlencoded/004-results.yml [deleted file]
t/data/urlencoded/005-headers.pml [new file with mode: 0644]
t/data/urlencoded/005-headers.yml [deleted file]
t/data/urlencoded/005-results.pml [new file with mode: 0644]
t/data/urlencoded/005-results.yml [deleted file]
t/data/urlencoded/006-headers.pml [new file with mode: 0644]
t/data/urlencoded/006-headers.yml [deleted file]
t/data/urlencoded/006-results.pml [new file with mode: 0644]
t/data/urlencoded/006-results.yml [deleted file]
t/data/xforms/001-headers.pml [new file with mode: 0644]
t/data/xforms/001-headers.yml [deleted file]
t/data/xforms/001-results.pml [new file with mode: 0644]
t/data/xforms/001-results.yml [deleted file]
t/data/xforms/002-headers.pml [new file with mode: 0644]
t/data/xforms/002-headers.yml [deleted file]
t/data/xforms/002-results.pml [new file with mode: 0644]
t/data/xforms/002-results.yml [deleted file]
t/lib/PAML.pm [new file with mode: 0644]

diff --git a/Changes b/Changes
index 789d200..31b7f1e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -5,6 +5,7 @@ This file documents the revision history for Perl extension HTTP::Body.
           during DESTROY. (Vany Serezhkin)
         - Fixed parsing of multipart bodies with boundaries that contain commas.
           (Tomas Doran, http://rt.cpan.org/Public/Bug/Display.html?id=41407)
+        - Dropped YAML, we now use Perl as a serialization format in our tests. We call this PAML ;)
 
 1.05    2008-12-01 17:15:00
         - Removed useless eval + require in new().
diff --git a/META.yml b/META.yml
deleted file mode 100644 (file)
index ba53ae4..0000000
--- a/META.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         HTTP-Body
-version:      0.9
-version_from: lib/HTTP/Body.pm
-installdirs:  site
-requires:
-    Carp:                          0
-    File::Temp:                    0.14
-    IO::File:                      0
-    YAML:                          0.39
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
index 398df81..2e92893 100644 (file)
@@ -11,6 +11,5 @@ WriteMakefile(
         HTTP::Headers => 0, 
         IO::File      => 0,
         Test::Deep    => 0,
-        YAML          => '0.39'
     }
 );
index a2735c7..844d3c0 100644 (file)
@@ -7,6 +7,7 @@ BEGIN {
 use strict;
 use warnings;
 use lib "$FindBin::Bin/../lib";
+use lib "$FindBin::Bin/../t/lib";
 
 use Benchmark   qw[cmpthese timethese];
 use CGI         qw[];
@@ -14,7 +15,7 @@ use CGI::Simple qw[];
 use HTTP::Body  qw[];
 use IO::Handle  qw[];
 use IO::File    qw[O_RDONLY SEEK_SET];
-use YAML        qw[LoadFile];
+use PAML        qw[LoadFile];
 
 my ( $headers, $content, $message );
 
@@ -97,7 +98,7 @@ my @benchmarks =  @ARGV ? @ARGV : qw[ t/data/benchmark/001
 
 foreach my $benchmark ( @benchmarks ) {
 
-    $headers  = LoadFile("$FindBin::Bin/../$benchmark-headers.yml");
+    $headers  = LoadFile("$FindBin::Bin/../$benchmark-headers.pml");
     $content  = IO::File->new( "$FindBin::Bin/../$benchmark-content.dat", O_RDONLY )
       or die $!;
 
index d33da20..8ca8ae3 100644 (file)
@@ -7,13 +7,14 @@ BEGIN {
 use strict;
 use warnings;
 use lib "$FindBin::Bin/../lib";
+use lib "$FindBin::Bin/../t/lib";
 
 use Benchmark   qw[timethese];
 use HTTP::Body  qw[];
 use IO::File    qw[O_RDONLY];
-use YAML        qw[LoadFile Dump];
+use PAML        qw[LoadFile];
 
-my $headers = LoadFile("t/data/multipart/003-headers.yml");
+my $headers = LoadFile("t/data/multipart/003-headers.pml");
 
 my $run = sub {
       my $bsize   = shift;
index bce0f85..b64b8bb 100644 (file)
@@ -3,6 +3,9 @@
 use strict;
 use warnings;
 
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
 use Test::More tests => 140;
 use Test::Deep;
 
@@ -10,7 +13,7 @@ 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() );
index 575a5ac..f92a9b6 100644 (file)
@@ -3,6 +3,9 @@
 use strict;
 use warnings;
 
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
 use Test::More tests => 31;
 
 use Cwd;
@@ -10,15 +13,15 @@ use Digest::MD5 qw(md5_hex);
 use HTTP::Body;
 use File::Spec::Functions;
 use IO::File;
-use YAML;
+use PAML;
 
 my $path = catdir( getcwd(), 't', 'data', 'urlencoded' );
 
 for ( my $i = 1; $i <= 6; $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'} );
 
index fde0383..16257b4 100644 (file)
@@ -1,20 +1,23 @@
 use strict;
 use warnings;
 
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
 use Test::More tests => 12;
 
 use Cwd;
 use HTTP::Body;
 use File::Spec::Functions;
 use IO::File;
-use YAML;
+use PAML;
 
 my $path = catdir( getcwd(), 't', 'data', 'octetstream' );
 
 for ( my $i = 1 ; $i <= 3 ; $i++ ) {
 
     my $test = sprintf( "%.3d", $i );
-    my $headers = YAML::LoadFile( catfile( $path, "$test-headers.yml" ) );
+    my $headers = PAML::LoadFile( catfile( $path, "$test-headers.pml" ) );
     my $results =
       slurp_fh( IO::File->new( catfile( $path, "$test-results.dat" ) ) );
     my $content = IO::File->new( catfile( $path, "$test-content.dat" ) );
index cf4ad9b..382cead 100644 (file)
@@ -3,21 +3,24 @@
 use strict;
 use warnings;
 
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
 use Test::More tests => 12;
 
 use Cwd;
 use HTTP::Body;
 use File::Spec::Functions;
 use IO::File;
-use YAML;
+use PAML;
 
 my $path = catdir( getcwd(), 't', 'data', 'xforms' );
 
 for ( my $i = 1; $i <= 2; $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'} );
 
diff --git a/t/data/benchmark/001-headers.pml b/t/data/benchmark/001-headers.pml
new file mode 100644 (file)
index 0000000..1773ab4
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "Benchmark" => "Message containing 4 parts, 2 with filename",
+  "Content-Length" => 4010288,
+  "Content-Type" => "multipart/form-data; boundary=xYzZY"
+}
diff --git a/t/data/benchmark/001-headers.yml b/t/data/benchmark/001-headers.yml
deleted file mode 100644 (file)
index 082fea8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 4010288
-Content-Type: multipart/form-data; boundary=xYzZY
-Benchmark: Message containing 4 parts, 2 with filename
diff --git a/t/data/benchmark/002-headers.pml b/t/data/benchmark/002-headers.pml
new file mode 100644 (file)
index 0000000..c80a287
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "Benchmark" => "Message containing 27 parts, none with filename",
+  "Content-Length" => 8088,
+  "Content-Type" => "multipart/form-data; boundary=xYzZY"
+}
diff --git a/t/data/benchmark/002-headers.yml b/t/data/benchmark/002-headers.yml
deleted file mode 100644 (file)
index dffc9a5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 8088
-Content-Type: multipart/form-data; boundary=xYzZY
-Benchmark: Message containing 27 parts, none with filename
diff --git a/t/data/benchmark/003-headers.pml b/t/data/benchmark/003-headers.pml
new file mode 100644 (file)
index 0000000..72fe9c9
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "Benchmark" => "Message containing 27 kv pairs",
+  "Content-Length" => 6622,
+  "Content-Type" => "application/x-www-form-urlencoded"
+}
diff --git a/t/data/benchmark/003-headers.yml b/t/data/benchmark/003-headers.yml
deleted file mode 100644 (file)
index 72bebbb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 6622
-Content-Type: application/x-www-form-urlencoded
-Benchmark: Message containing 27 kv pairs
diff --git a/t/data/multipart/001-headers.pml b/t/data/multipart/001-headers.pml
new file mode 100644 (file)
index 0000000..ed02a1f
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+  "Content-Length" => 1817,
+  "Content-Type" => "multipart/form-data; boundary=----------0xKhTmLbOuNdArY"
+}
diff --git a/t/data/multipart/001-headers.yml b/t/data/multipart/001-headers.yml
deleted file mode 100644 (file)
index 15c1382..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1817
-Content-Type: multipart/form-data; boundary=----------0xKhTmLbOuNdArY
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
diff --git a/t/data/multipart/001-results.pml b/t/data/multipart/001-results.pml
new file mode 100644 (file)
index 0000000..dd4085a
--- /dev/null
@@ -0,0 +1,60 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Type" => "application/octet-stream",
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"hello.pl\""
+      },
+      "filename" => "hello.pl",
+      "name" => "upload2",
+      "size" => 78
+    },
+    "upload4" => {
+      "headers" => {
+        "Content-Disposition" => "form-data; name=\"upload4\"; filename=\"0\""
+      },
+      "filename" => 0,
+      "name" => "upload4",
+      "size" => 0
+    },
+    "upload3" => {
+      "headers" => {
+        "Content-Type" => "application/octet-stream",
+        "Content-Disposition" => "form-data; name=\"upload3\"; filename=\"blank.pl\""
+      },
+      "filename" => "blank.pl",
+      "name" => "upload3",
+      "size" => 0
+    },
+    "upload" => [
+      {
+        "headers" => {
+          "Content-Type" => "application/octet-stream",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+        },
+        "filename" => "hello.pl",
+        "name" => "upload",
+        "size" => 78
+      },
+      {
+        "headers" => {
+          "Content-Type" => "application/octet-stream",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+        },
+        "filename" => "hello.pl",
+        "name" => "upload",
+        "size" => 78
+      }
+    ]
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/001-results.yml b/t/data/multipart/001-results.yml
deleted file mode 100644 (file)
index 7641e40..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
-  upload:
-    - filename: hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="hello.pl"
-        Content-Type: application/octet-stream
-      name: upload
-      size: 78
-    - filename: hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="hello.pl"
-        Content-Type: application/octet-stream
-      name: upload
-      size: 78
-  upload2:
-    filename: hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="hello.pl"
-      Content-Type: application/octet-stream
-    name: upload2
-    size: 78
-  upload3:
-    filename: blank.pl
-    headers:
-      Content-Disposition: form-data; name="upload3"; filename="blank.pl"
-      Content-Type: application/octet-stream
-    name: upload3
-    size: 0
-  upload4:
-    filename: 0
-    headers:
-      Content-Disposition: form-data; name="upload4"; filename="0"
-    name: upload4
-    size: 0
diff --git a/t/data/multipart/002-headers.pml b/t/data/multipart/002-headers.pml
new file mode 100644 (file)
index 0000000..5867901
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Lynx/2.8.5rel.2 libwww-FM/2.14",
+  "Content-Length" => 1585,
+  "Content-Type" => "multipart/form-data; boundary=LYNX"
+}
diff --git a/t/data/multipart/002-headers.yml b/t/data/multipart/002-headers.yml
deleted file mode 100644 (file)
index bf95402..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1585
-Content-Type: multipart/form-data; boundary=LYNX
-User-Agent: Lynx/2.8.5rel.2 libwww-FM/2.14
diff --git a/t/data/multipart/002-results.pml b/t/data/multipart/002-results.pml
new file mode 100644 (file)
index 0000000..b73fec4
--- /dev/null
@@ -0,0 +1,43 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"/Users/chansen/hello.pl\""
+      },
+      "filename" => "/Users/chansen/hello.pl",
+      "name" => "upload2",
+      "size" => 71
+    },
+    "upload" => [
+      {
+        "headers" => {
+          "Content-Type" => "text/plain",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"/Users/chansen/hello.pl\""
+        },
+        "filename" => "/Users/chansen/hello.pl",
+        "name" => "upload",
+        "size" => 71
+      },
+      {
+        "headers" => {
+          "Content-Type" => "text/plain",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"/Users/chansen/hello.pl\""
+        },
+        "filename" => "/Users/chansen/hello.pl",
+        "name" => "upload",
+        "size" => 71
+      }
+    ]
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.\r\n",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/002-results.yml b/t/data/multipart/002-results.yml
deleted file mode 100644 (file)
index d2e1e3b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.\r\n"
-upload:
-  upload:
-    - filename: /Users/chansen/hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="/Users/chansen/hello.pl"
-        Content-Type: text/plain
-      name: upload
-      size: 71
-    - filename: /Users/chansen/hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="/Users/chansen/hello.pl"
-        Content-Type: text/plain
-      name: upload
-      size: 71
-  upload2:
-    filename: /Users/chansen/hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="/Users/chansen/hello.pl"
-      Content-Type: text/plain
-    name: upload2
-    size: 71
diff --git a/t/data/multipart/003-headers.pml b/t/data/multipart/003-headers.pml
new file mode 100644 (file)
index 0000000..ef4efd4
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "ELinks/0.9.2 (textmode; Darwin 7.9.0 Power Macintosh; 167x36)",
+  "Content-Length" => 1507,
+  "Content-Type" => "multipart/form-data; boundary=00000000000000000000000000000000"
+}
diff --git a/t/data/multipart/003-headers.yml b/t/data/multipart/003-headers.yml
deleted file mode 100644 (file)
index 9895c88..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1507
-Content-Type: multipart/form-data; boundary=00000000000000000000000000000000
-User-Agent: ELinks/0.9.2 (textmode; Darwin 7.9.0 Power Macintosh; 167x36)
diff --git a/t/data/multipart/003-results.pml b/t/data/multipart/003-results.pml
new file mode 100644 (file)
index 0000000..ae3597c
--- /dev/null
@@ -0,0 +1,40 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"hello.pl\""
+      },
+      "filename" => "hello.pl",
+      "name" => "upload2",
+      "size" => 71
+    },
+    "upload" => [
+      {
+        "headers" => {
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+        },
+        "filename" => "hello.pl",
+        "name" => "upload",
+        "size" => 71
+      },
+      {
+        "headers" => {
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+        },
+        "filename" => "hello.pl",
+        "name" => "upload",
+        "size" => 71
+      }
+    ]
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\n\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/003-results.yml b/t/data/multipart/003-results.yml
deleted file mode 100644 (file)
index 31e6817..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\n\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
-  upload:
-    - filename: hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="hello.pl"
-      name: upload
-      size: 71
-    - filename: hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="hello.pl"
-      name: upload
-      size: 71
-  upload2:
-    filename: hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="hello.pl"
-    name: upload2
-    size: 71
diff --git a/t/data/multipart/004-headers.pml b/t/data/multipart/004-headers.pml
new file mode 100644 (file)
index 0000000..daa4397
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)",
+  "Content-Length" => 1987,
+  "Content-Type" => "multipart/form-data; boundary=---------------------------168071508944249"
+}
diff --git a/t/data/multipart/004-headers.yml b/t/data/multipart/004-headers.yml
deleted file mode 100644 (file)
index f56c767..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1987
-Content-Type: multipart/form-data; boundary=---------------------------168071508944249
-User-Agent: Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)
diff --git a/t/data/multipart/004-results.pml b/t/data/multipart/004-results.pml
new file mode 100644 (file)
index 0000000..9a5d69f
--- /dev/null
@@ -0,0 +1,43 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Type" => "application/octet-stream",
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"hello.pl\""
+      },
+      "filename" => "hello.pl",
+      "name" => "upload2",
+      "size" => 71
+    },
+    "upload" => [
+      {
+        "headers" => {
+          "Content-Type" => "application/octet-stream",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+        },
+        "filename" => "hello.pl",
+        "name" => "upload",
+        "size" => 71
+      },
+      {
+        "headers" => {
+          "Content-Type" => "application/octet-stream",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+        },
+        "filename" => "hello.pl",
+        "name" => "upload",
+        "size" => 71
+      }
+    ]
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/004-results.yml b/t/data/multipart/004-results.yml
deleted file mode 100644 (file)
index 642bfb0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
-  upload:
-    - filename: hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="hello.pl"
-        Content-Type: application/octet-stream
-      name: upload
-      size: 71
-    - filename: hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="hello.pl"
-        Content-Type: application/octet-stream
-      name: upload
-      size: 71
-  upload2:
-    filename: hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="hello.pl"
-      Content-Type: application/octet-stream
-    name: upload2
-    size: 71
diff --git a/t/data/multipart/005-headers.pml b/t/data/multipart/005-headers.pml
new file mode 100644 (file)
index 0000000..18645d7
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4",
+  "Content-Length" => 1817,
+  "Content-Type" => "multipart/form-data; boundary=---------------------------168072824752491622650073"
+}
diff --git a/t/data/multipart/005-headers.yml b/t/data/multipart/005-headers.yml
deleted file mode 100644 (file)
index 2041da1..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1817
-Content-Type: multipart/form-data; boundary=---------------------------168072824752491622650073
-User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
diff --git a/t/data/multipart/005-results.pml b/t/data/multipart/005-results.pml
new file mode 100644 (file)
index 0000000..95f31e2
--- /dev/null
@@ -0,0 +1,43 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"hello.pl\""
+      },
+      "filename" => "hello.pl",
+      "name" => "upload2",
+      "size" => 71
+    },
+    "upload" => [
+      {
+        "headers" => {
+          "Content-Type" => "text/plain",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+        },
+        "filename" => "hello.pl",
+        "name" => "upload",
+        "size" => 71
+      },
+      {
+        "headers" => {
+          "Content-Type" => "text/plain",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+        },
+        "filename" => "hello.pl",
+        "name" => "upload",
+        "size" => 71
+      }
+    ]
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/005-results.yml b/t/data/multipart/005-results.yml
deleted file mode 100644 (file)
index b4063a6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
-  upload:
-    - filename: hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="hello.pl"
-        Content-Type: text/plain
-      name: upload
-      size: 71
-    - filename: hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="hello.pl"
-        Content-Type: text/plain
-      name: upload
-      size: 71
-  upload2:
-    filename: hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="hello.pl"
-      Content-Type: text/plain
-    name: upload2
-    size: 71
diff --git a/t/data/multipart/006-headers.pml b/t/data/multipart/006-headers.pml
new file mode 100644 (file)
index 0000000..13f10c2
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)",
+  "Content-Length" => 1740,
+  "Content-Type" => "multipart/form-data; boundary=---------------------------7d53c2922c"
+}
diff --git a/t/data/multipart/006-headers.yml b/t/data/multipart/006-headers.yml
deleted file mode 100644 (file)
index af0a4f9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1740
-Content-Type: multipart/form-data; boundary=---------------------------7d53c2922c
-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
diff --git a/t/data/multipart/006-results.pml b/t/data/multipart/006-results.pml
new file mode 100644 (file)
index 0000000..b5ee5e6
--- /dev/null
@@ -0,0 +1,43 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+      },
+      "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+      "name" => "upload2",
+      "size" => 71
+    },
+    "upload" => [
+      {
+        "headers" => {
+          "Content-Type" => "text/plain",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+        },
+        "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+        "name" => "upload",
+        "size" => 71
+      },
+      {
+        "headers" => {
+          "Content-Type" => "text/plain",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+        },
+        "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+        "name" => "upload",
+        "size" => 71
+      }
+    ]
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/006-results.yml b/t/data/multipart/006-results.yml
deleted file mode 100644 (file)
index 0331f73..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
-  upload:
-    - filename: C:\WINDOWS\Skrivbord\hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="C:\WINDOWS\Skrivbord\hello.pl"
-        Content-Type: text/plain
-      name: upload
-      size: 71
-    - filename: C:\WINDOWS\Skrivbord\hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="C:\WINDOWS\Skrivbord\hello.pl"
-        Content-Type: text/plain
-      name: upload
-      size: 71
-  upload2:
-    filename: C:\WINDOWS\Skrivbord\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="C:\WINDOWS\Skrivbord\hello.pl"
-      Content-Type: text/plain
-    name: upload2
-    size: 71
diff --git a/t/data/multipart/007-headers.pml b/t/data/multipart/007-headers.pml
new file mode 100644 (file)
index 0000000..b17b923
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Mac_PowerPC Mac OS X; en) Opera 8.01",
+  "Content-Length" => 1629,
+  "Content-Type" => "multipart/form-data; boundary=----------Bv684bhJBhreYbdRAUxHhF"
+}
diff --git a/t/data/multipart/007-headers.yml b/t/data/multipart/007-headers.yml
deleted file mode 100644 (file)
index 1e7208a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1629
-Content-Type: multipart/form-data; boundary=----------Bv684bhJBhreYbdRAUxHhF
-User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Mac_PowerPC Mac OS X; en) Opera 8.01
diff --git a/t/data/multipart/007-results.pml b/t/data/multipart/007-results.pml
new file mode 100644 (file)
index 0000000..9a5d69f
--- /dev/null
@@ -0,0 +1,43 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Type" => "application/octet-stream",
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"hello.pl\""
+      },
+      "filename" => "hello.pl",
+      "name" => "upload2",
+      "size" => 71
+    },
+    "upload" => [
+      {
+        "headers" => {
+          "Content-Type" => "application/octet-stream",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+        },
+        "filename" => "hello.pl",
+        "name" => "upload",
+        "size" => 71
+      },
+      {
+        "headers" => {
+          "Content-Type" => "application/octet-stream",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"hello.pl\""
+        },
+        "filename" => "hello.pl",
+        "name" => "upload",
+        "size" => 71
+      }
+    ]
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/007-results.yml b/t/data/multipart/007-results.yml
deleted file mode 100644 (file)
index 642bfb0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
-  upload:
-    - filename: hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="hello.pl"
-        Content-Type: application/octet-stream
-      name: upload
-      size: 71
-    - filename: hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="hello.pl"
-        Content-Type: application/octet-stream
-      name: upload
-      size: 71
-  upload2:
-    filename: hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="hello.pl"
-      Content-Type: application/octet-stream
-    name: upload2
-    size: 71
diff --git a/t/data/multipart/008-headers.pml b/t/data/multipart/008-headers.pml
new file mode 100644 (file)
index 0000000..6e2692d
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)",
+  "Content-Length" => 1750,
+  "Content-Type" => "multipart/form-data; boundary=---------------------------7d52bc247fc"
+}
diff --git a/t/data/multipart/008-headers.yml b/t/data/multipart/008-headers.yml
deleted file mode 100644 (file)
index b1f2567..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1750
-Content-Type: multipart/form-data; boundary=---------------------------7d52bc247fc
-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
diff --git a/t/data/multipart/008-results.pml b/t/data/multipart/008-results.pml
new file mode 100644 (file)
index 0000000..b5ee5e6
--- /dev/null
@@ -0,0 +1,43 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+      },
+      "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+      "name" => "upload2",
+      "size" => 71
+    },
+    "upload" => [
+      {
+        "headers" => {
+          "Content-Type" => "text/plain",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+        },
+        "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+        "name" => "upload",
+        "size" => 71
+      },
+      {
+        "headers" => {
+          "Content-Type" => "text/plain",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\WINDOWS\\Skrivbord\\hello.pl\""
+        },
+        "filename" => "C:\\WINDOWS\\Skrivbord\\hello.pl",
+        "name" => "upload",
+        "size" => 71
+      }
+    ]
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/008-results.yml b/t/data/multipart/008-results.yml
deleted file mode 100644 (file)
index 0331f73..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
-  upload:
-    - filename: C:\WINDOWS\Skrivbord\hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="C:\WINDOWS\Skrivbord\hello.pl"
-        Content-Type: text/plain
-      name: upload
-      size: 71
-    - filename: C:\WINDOWS\Skrivbord\hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="C:\WINDOWS\Skrivbord\hello.pl"
-        Content-Type: text/plain
-      name: upload
-      size: 71
-  upload2:
-    filename: C:\WINDOWS\Skrivbord\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="C:\WINDOWS\Skrivbord\hello.pl"
-      Content-Type: text/plain
-    name: upload2
-    size: 71
diff --git a/t/data/multipart/009-headers.pml b/t/data/multipart/009-headers.pml
new file mode 100644 (file)
index 0000000..69bba78
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)",
+  "Content-Length" => 1851,
+  "Content-Type" => "multipart/form-data; boundary=---------------------------7d53941f40118"
+}
diff --git a/t/data/multipart/009-headers.yml b/t/data/multipart/009-headers.yml
deleted file mode 100644 (file)
index ec3b8e4..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1851
-Content-Type: multipart/form-data; boundary=---------------------------7d53941f40118
-User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
diff --git a/t/data/multipart/009-results.pml b/t/data/multipart/009-results.pml
new file mode 100644 (file)
index 0000000..2907b2f
--- /dev/null
@@ -0,0 +1,43 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+      },
+      "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+      "name" => "upload2",
+      "size" => 71
+    },
+    "upload" => [
+      {
+        "headers" => {
+          "Content-Type" => "text/plain",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+        },
+        "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+        "name" => "upload",
+        "size" => 71
+      },
+      {
+        "headers" => {
+          "Content-Type" => "text/plain",
+          "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+        },
+        "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+        "name" => "upload",
+        "size" => 71
+      }
+    ]
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/009-results.yml b/t/data/multipart/009-results.yml
deleted file mode 100644 (file)
index 32f5af1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
-  upload:
-    - filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-        Content-Type: text/plain
-      name: upload
-      size: 71
-    - filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-      headers:
-        Content-Disposition: form-data; name="upload"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-        Content-Type: text/plain
-      name: upload
-      size: 71
-  upload2:
-    filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-      Content-Type: text/plain
-    name: upload2
-    size: 71
diff --git a/t/data/multipart/010-headers.pml b/t/data/multipart/010-headers.pml
new file mode 100644 (file)
index 0000000..e36cb58
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)",
+  "Content-Length" => 1831,
+  "Content-Type" => "multipart/form-data; boundary=---------------------------7d561c5012e"
+}
diff --git a/t/data/multipart/010-headers.yml b/t/data/multipart/010-headers.yml
deleted file mode 100644 (file)
index 7dae7fe..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1831
-Content-Type: multipart/form-data; boundary=---------------------------7d561c5012e
-User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
diff --git a/t/data/multipart/010-results.pml b/t/data/multipart/010-results.pml
new file mode 100644 (file)
index 0000000..5d11a0a
--- /dev/null
@@ -0,0 +1,41 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+      },
+      "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+      "name" => "upload2",
+      "size" => 71
+    },
+    "upload" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+      },
+      "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+      "name" => "upload",
+      "size" => 71
+    },
+    "upload1" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload1\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+      },
+      "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+      "name" => "upload1",
+      "size" => 71
+    }
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/010-results.yml b/t/data/multipart/010-results.yml
deleted file mode 100644 (file)
index 28c5f03..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
-  upload:
-    filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-      Content-Type: text/plain
-    name: upload
-    size: 71
-  upload1:
-    filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload1"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-      Content-Type: text/plain
-    name: upload1
-    size: 71
-  upload2:
-    filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-      Content-Type: text/plain
-    name: upload2
-    size: 71
diff --git a/t/data/multipart/011-headers.pml b/t/data/multipart/011-headers.pml
new file mode 100644 (file)
index 0000000..91dca2b
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)",
+  "Content-Length" => 1851,
+  "Content-Type" => "multipart/form-data; boundary=---------------------------7d534d1d60150"
+}
diff --git a/t/data/multipart/011-headers.yml b/t/data/multipart/011-headers.yml
deleted file mode 100644 (file)
index 2ed7715..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1851
-Content-Type: multipart/form-data; boundary=---------------------------7d534d1d60150
-User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
diff --git a/t/data/multipart/011-results.pml b/t/data/multipart/011-results.pml
new file mode 100644 (file)
index 0000000..5d11a0a
--- /dev/null
@@ -0,0 +1,41 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+      },
+      "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+      "name" => "upload2",
+      "size" => 71
+    },
+    "upload" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+      },
+      "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+      "name" => "upload",
+      "size" => 71
+    },
+    "upload1" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload1\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+      },
+      "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+      "name" => "upload1",
+      "size" => 71
+    }
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/011-results.yml b/t/data/multipart/011-results.yml
deleted file mode 100644 (file)
index 28c5f03..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
-  upload:
-    filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-      Content-Type: text/plain
-    name: upload
-    size: 71
-  upload1:
-    filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload1"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-      Content-Type: text/plain
-    name: upload1
-    size: 71
-  upload2:
-    filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-      Content-Type: text/plain
-    name: upload2
-    size: 71
diff --git a/t/data/multipart/012-headers.pml b/t/data/multipart/012-headers.pml
new file mode 100644 (file)
index 0000000..e0a1fc4
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)",
+  "Content-Type" => "multipart/form-data; boundary=---------------------------7d534d1d60150",
+  "Transfer-Encoding" => "chunked"
+}
diff --git a/t/data/multipart/012-headers.yml b/t/data/multipart/012-headers.yml
deleted file mode 100644 (file)
index 39b8281..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Transfer-Encoding: chunked
-Content-Type: multipart/form-data; boundary=---------------------------7d534d1d60150
-User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
diff --git a/t/data/multipart/012-results.pml b/t/data/multipart/012-results.pml
new file mode 100644 (file)
index 0000000..5d11a0a
--- /dev/null
@@ -0,0 +1,41 @@
+{
+  "body" => undef,
+  "upload" => {
+    "upload2" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload2\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+      },
+      "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+      "name" => "upload2",
+      "size" => 71
+    },
+    "upload" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+      },
+      "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+      "name" => "upload",
+      "size" => 71
+    },
+    "upload1" => {
+      "headers" => {
+        "Content-Type" => "text/plain",
+        "Content-Disposition" => "form-data; name=\"upload1\"; filename=\"C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl\""
+      },
+      "filename" => "C:\\Documents and Settings\\Administrator\\Desktop\\hello.pl",
+      "name" => "upload1",
+      "size" => 71
+    }
+  },
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/012-results.yml b/t/data/multipart/012-results.yml
deleted file mode 100644 (file)
index 28c5f03..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-upload:
-  upload:
-    filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-      Content-Type: text/plain
-    name: upload
-    size: 71
-  upload1:
-    filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload1"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-      Content-Type: text/plain
-    name: upload1
-    size: 71
-  upload2:
-    filename: C:\Documents and Settings\Administrator\Desktop\hello.pl
-    headers:
-      Content-Disposition: form-data; name="upload2"; filename="C:\Documents and Settings\Administrator\Desktop\hello.pl"
-      Content-Type: text/plain
-    name: upload2
-    size: 71
diff --git a/t/data/multipart/013-headers.pml b/t/data/multipart/013-headers.pml
new file mode 100644 (file)
index 0000000..11488d5
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+  "Content-Length" => 900,
+  "Content-Type" => "multipart/form-data; boundary=----------0x'K()h+T_m,L-b.O/u:N=d?ArY"
+}
diff --git a/t/data/multipart/013-headers.yml b/t/data/multipart/013-headers.yml
deleted file mode 100644 (file)
index 9dc742e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 900
-Content-Type: multipart/form-data; boundary=----------0x'K()h+T_m,L-b.O/u:N=d?ArY
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
diff --git a/t/data/multipart/013-results.pml b/t/data/multipart/013-results.pml
new file mode 100644 (file)
index 0000000..aa9d747
--- /dev/null
@@ -0,0 +1,12 @@
+{
+  "body" => undef,
+  "param" => {
+    "text2" => "",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/multipart/013-results.yml b/t/data/multipart/013-results.yml
deleted file mode 100644 (file)
index eea2341..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: ""
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
diff --git a/t/data/octetstream/001-headers.pml b/t/data/octetstream/001-headers.pml
new file mode 100644 (file)
index 0000000..1ace639
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+  "Content-Length" => 4,
+  "Content-Type" => "application/octet-stream"
+}
diff --git a/t/data/octetstream/001-headers.yml b/t/data/octetstream/001-headers.yml
deleted file mode 100644 (file)
index 99ff2b1..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 4
-Content-Type: application/octet-stream
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
diff --git a/t/data/octetstream/002-headers.pml b/t/data/octetstream/002-headers.pml
new file mode 100644 (file)
index 0000000..4498cee
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+  "Content-Length" => 1025,
+  "Content-Type" => "application/x.atom+xml"
+}
diff --git a/t/data/octetstream/002-headers.yml b/t/data/octetstream/002-headers.yml
deleted file mode 100644 (file)
index 152afff..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 1025
-Content-Type: application/x.atom+xml
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
diff --git a/t/data/octetstream/003-headers.pml b/t/data/octetstream/003-headers.pml
new file mode 100644 (file)
index 0000000..0e65d9f
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+  "Content-Type" => "application/x.atom+xml",
+  "Transfer-Encoding" => "chunked"
+}
diff --git a/t/data/octetstream/003-headers.yml b/t/data/octetstream/003-headers.yml
deleted file mode 100644 (file)
index 21d05b7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Transfer-Encoding: chunked
-Content-Type: application/x.atom+xml
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
diff --git a/t/data/urlencoded/001-headers.pml b/t/data/urlencoded/001-headers.pml
new file mode 100644 (file)
index 0000000..345eb7a
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+  "Content-Length" => 499,
+  "Content-Type" => "application/x-www-form-urlencoded"
+}
diff --git a/t/data/urlencoded/001-headers.yml b/t/data/urlencoded/001-headers.yml
deleted file mode 100644 (file)
index e041c87..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 499
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
diff --git a/t/data/urlencoded/001-results.pml b/t/data/urlencoded/001-results.pml
new file mode 100644 (file)
index 0000000..574091d
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "body" => undef,
+  "upload" => {},
+  "param" => {
+    "text2" => "\303\245\303\244\303\266\303\245\303\244\303\266",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "encoding" => "foo=bar",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/urlencoded/001-results.yml b/t/data/urlencoded/001-results.yml
deleted file mode 100644 (file)
index 1571078..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: åäöåäö
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-  encoding: foo=bar
-upload: {}
diff --git a/t/data/urlencoded/002-headers.pml b/t/data/urlencoded/002-headers.pml
new file mode 100644 (file)
index 0000000..23939c5
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)",
+  "Content-Length" => 15,
+  "Content-Type" => "application/x-www-form-urlencoded"
+}
diff --git a/t/data/urlencoded/002-headers.yml b/t/data/urlencoded/002-headers.yml
deleted file mode 100644 (file)
index 9377827..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 15
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
diff --git a/t/data/urlencoded/002-results.pml b/t/data/urlencoded/002-results.pml
new file mode 100644 (file)
index 0000000..1fd9cff
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "body" => undef,
+  "upload" => {},
+  "param" => {
+    "one" => "foo",
+    "two" => "bar"
+  }
+}
diff --git a/t/data/urlencoded/002-results.yml b/t/data/urlencoded/002-results.yml
deleted file mode 100644 (file)
index 23e78de..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
----
-body: ~
-param:
-  one: foo
-  two: bar
-upload: {}
diff --git a/t/data/urlencoded/003-headers.pml b/t/data/urlencoded/003-headers.pml
new file mode 100644 (file)
index 0000000..4bec168
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+  "Content-Type" => "application/x-www-form-urlencoded",
+  "Transfer-Encoding" => "chunked"
+}
diff --git a/t/data/urlencoded/003-headers.yml b/t/data/urlencoded/003-headers.yml
deleted file mode 100644 (file)
index 21e3480..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Transfer-Encoding: chunked
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
diff --git a/t/data/urlencoded/003-results.pml b/t/data/urlencoded/003-results.pml
new file mode 100644 (file)
index 0000000..574091d
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "body" => undef,
+  "upload" => {},
+  "param" => {
+    "text2" => "\303\245\303\244\303\266\303\245\303\244\303\266",
+    "text1" => "Ratione accusamus aspernatur aliquam",
+    "encoding" => "foo=bar",
+    "textarea" => "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa.",
+    "select" => [
+      "A",
+      "B"
+    ]
+  }
+}
diff --git a/t/data/urlencoded/003-results.yml b/t/data/urlencoded/003-results.yml
deleted file mode 100644 (file)
index 1571078..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
----
-body: ~
-param:
-  select:
-    - A
-    - B
-  text1: Ratione accusamus aspernatur aliquam
-  text2: åäöåäö
-  textarea: "Voluptatem cumque voluptate sit recusandae at. Et quas facere rerum unde esse. Sit est et voluptatem. Vel temporibus velit neque odio non.\r\n\r\nMolestias rerum ut sapiente facere repellendus illo. Eum nulla quis aut. Quidem voluptas vitae ipsam officia voluptatibus eveniet. Aspernatur cupiditate ratione aliquam quidem corrupti. Eos sunt rerum non optio culpa."
-  encoding: foo=bar
-upload: {}
diff --git a/t/data/urlencoded/004-headers.pml b/t/data/urlencoded/004-headers.pml
new file mode 100644 (file)
index 0000000..c9ea413
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)",
+  "Content-Length" => 16,
+  "Content-Type" => "application/x-www-form-urlencoded"
+}
diff --git a/t/data/urlencoded/004-headers.yml b/t/data/urlencoded/004-headers.yml
deleted file mode 100644 (file)
index 203c3f6..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 16
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
diff --git a/t/data/urlencoded/004-results.pml b/t/data/urlencoded/004-results.pml
new file mode 100644 (file)
index 0000000..1fd9cff
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "body" => undef,
+  "upload" => {},
+  "param" => {
+    "one" => "foo",
+    "two" => "bar"
+  }
+}
diff --git a/t/data/urlencoded/004-results.yml b/t/data/urlencoded/004-results.yml
deleted file mode 100644 (file)
index 23e78de..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
----
-body: ~
-param:
-  one: foo
-  two: bar
-upload: {}
diff --git a/t/data/urlencoded/005-headers.pml b/t/data/urlencoded/005-headers.pml
new file mode 100644 (file)
index 0000000..23939c5
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)",
+  "Content-Length" => 15,
+  "Content-Type" => "application/x-www-form-urlencoded"
+}
diff --git a/t/data/urlencoded/005-headers.yml b/t/data/urlencoded/005-headers.yml
deleted file mode 100644 (file)
index 9377827..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 15
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
diff --git a/t/data/urlencoded/005-results.pml b/t/data/urlencoded/005-results.pml
new file mode 100644 (file)
index 0000000..1fd9cff
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "body" => undef,
+  "upload" => {},
+  "param" => {
+    "one" => "foo",
+    "two" => "bar"
+  }
+}
diff --git a/t/data/urlencoded/005-results.yml b/t/data/urlencoded/005-results.yml
deleted file mode 100644 (file)
index 23e78de..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
----
-body: ~
-param:
-  one: foo
-  two: bar
-upload: {}
diff --git a/t/data/urlencoded/006-headers.pml b/t/data/urlencoded/006-headers.pml
new file mode 100644 (file)
index 0000000..6e9a8f8
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)",
+  "Content-Length" => 19,
+  "Content-Type" => "application/x-www-form-urlencoded"
+}
diff --git a/t/data/urlencoded/006-headers.yml b/t/data/urlencoded/006-headers.yml
deleted file mode 100644 (file)
index ce69c82..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 19
-Content-Type: application/x-www-form-urlencoded
-User-Agent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
diff --git a/t/data/urlencoded/006-results.pml b/t/data/urlencoded/006-results.pml
new file mode 100644 (file)
index 0000000..c44c760
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "body" => undef,
+  "upload" => {},
+  "param" => {
+    "one" => "foo",
+    "two" => "bar=bam"
+  }
+}
diff --git a/t/data/urlencoded/006-results.yml b/t/data/urlencoded/006-results.yml
deleted file mode 100644 (file)
index ccfab1f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
----
-body: ~
-param:
-  one: foo
-  two: bar=bam
-upload: {}
diff --git a/t/data/xforms/001-headers.pml b/t/data/xforms/001-headers.pml
new file mode 100644 (file)
index 0000000..3ee6187
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+  "Content-Length" => 313,
+  "Content-Type" => "multipart/related; boundary=----------0xKhTmLbOuNdArY; start=<asdfg\@asdfg.com>"
+}
diff --git a/t/data/xforms/001-headers.yml b/t/data/xforms/001-headers.yml
deleted file mode 100644 (file)
index 1646d54..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 313
-Content-Type: multipart/related; boundary=----------0xKhTmLbOuNdArY; start=<asdfg@asdfg.com>
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
diff --git a/t/data/xforms/001-results.pml b/t/data/xforms/001-results.pml
new file mode 100644 (file)
index 0000000..6b87330
--- /dev/null
@@ -0,0 +1,25 @@
+{
+  "body" => "<model><data1>asdfg</data1><data2>asdfg</data2></model>",
+  "upload" => {
+    "zxcvb\@zxcvb.com" => {
+      "headers" => {
+        "Content-ID" => "<zxcvb\@zxcvb.com>"
+      },
+      "filename" => "zxcvb\@zxcvb.com",
+      "name" => "zxcvb\@zxcvb.com",
+      "size" => 17
+    },
+    "qwert\@qwerty.com" => {
+      "headers" => {
+        "Content-ID" => "<qwert\@qwerty.com>"
+      },
+      "filename" => "qwert\@qwerty.com",
+      "name" => "qwert\@qwerty.com",
+      "size" => 17
+    }
+  },
+  "param" => {
+    "XForms:Model" => "<model><data1>asdfg</data1><data2>asdfg</data2></model>"
+  },
+  "start" => "asdfg\@asdfg.com"
+}
diff --git a/t/data/xforms/001-results.yml b/t/data/xforms/001-results.yml
deleted file mode 100644 (file)
index 77c8d3f..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
----
-body: <model><data1>asdfg</data1><data2>asdfg</data2></model>
-start: asdfg@asdfg.com
-param:
-  XForms:Model: <model><data1>asdfg</data1><data2>asdfg</data2></model>
-upload:
-  qwert@qwerty.com:
-    filename: qwert@qwerty.com
-    headers:
-      Content-ID: <qwert@qwerty.com>
-    name: qwert@qwerty.com
-    size: 17
-  zxcvb@zxcvb.com:
-    filename: zxcvb@zxcvb.com
-    headers:
-      Content-ID: <zxcvb@zxcvb.com>
-    name: zxcvb@zxcvb.com
-    size: 17
diff --git a/t/data/xforms/002-headers.pml b/t/data/xforms/002-headers.pml
new file mode 100644 (file)
index 0000000..19e4108
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "User-Agent" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312",
+  "Content-Length" => 55,
+  "Content-Type" => "application/xml"
+}
diff --git a/t/data/xforms/002-headers.yml b/t/data/xforms/002-headers.yml
deleted file mode 100644 (file)
index b5dae66..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-Content-Length: 55
-Content-Type: application/xml
-User-Agent: 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko) Safari/312'
diff --git a/t/data/xforms/002-results.pml b/t/data/xforms/002-results.pml
new file mode 100644 (file)
index 0000000..a55b4b6
--- /dev/null
@@ -0,0 +1,7 @@
+{
+  "body" => "<model><data1>asdfg</data1><data2>asdfg</data2></model>",
+  "upload" => {},
+  "param" => {
+    "XForms:Model" => "<model><data1>asdfg</data1><data2>asdfg</data2></model>"
+  }
+}
diff --git a/t/data/xforms/002-results.yml b/t/data/xforms/002-results.yml
deleted file mode 100644 (file)
index f5298ba..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
----
-body: <model><data1>asdfg</data1><data2>asdfg</data2></model>
-param:
-  XForms:Model: <model><data1>asdfg</data1><data2>asdfg</data2></model>
-upload: {}
diff --git a/t/lib/PAML.pm b/t/lib/PAML.pm
new file mode 100644 (file)
index 0000000..f24ba5d
--- /dev/null
@@ -0,0 +1,84 @@
+package PAML;
+use strict;
+use warnings;
+
+# "PAML Ain't Markup Language"!!!
+
+use Carp         qw[croak];
+use Data::Dumper qw[];
+use IO::File     qw[];
+
+BEGIN {
+    our @EXPORT_OK = qw(
+        DumpFile
+        LoadFile
+    );
+
+    require Exporter;
+    *import = \&Exporter::import;
+}
+
+sub DumpFile ($$) {
+    my ($path, $struct) = @_;
+
+    my $data = do {
+        local $Data::Dumper::Indent = 1;
+        local $Data::Dumper::Purity = 1;
+        local $Data::Dumper::Terse  = 1;
+        local $Data::Dumper::Useqq  = 1;
+        Data::Dumper->Dump([$struct], ['PAML']);
+    };
+
+    my $io = IO::File->new($path, '>')
+      || croak(qq[Couldn't open path '$path' in write mode: $!]);
+
+    $io->binmode
+      || croak(qq[Couldn't binmode filehandle: $!]);
+
+    $io->print($data)
+      || croak(qq[Couldn't write filehandle: $!]);
+
+    $io->close
+      || croak(qq[Couldn't close filehandle: $!]);
+
+    1;
+}
+
+sub LoadFile ($) {
+    my ($path) = @_;
+
+    my $data = do {
+
+        my $io = IO::File->new($path, '<')
+          || corak(qq[Couldn't open path '$path' in read mode: $!]);
+
+        $io->binmode
+          || croak(qq[Couldn't binmode filehandle: $!]);
+
+        my $exp = -s $path;
+        my $buf = do { local $/; <$io> };
+        my $got = length $buf;
+
+        $io->close
+          || croak(qq[Couldn't close filehandle: $!]);
+
+        ($exp == $got)
+          || croak(qq[I/O read mismatch, expexted: $exp got: $got]);
+
+        $buf;
+    };
+
+    if (substr($data, 0, 1) eq '{') {
+        substr($data, 0, 0, '+');
+    }
+
+    my $struct = eval($data);
+
+    (!$@)
+      || croak(qq[LoadFile couldn't eval data: $@]);
+
+    $struct;
+}
+
+1;
+