| 1 |
#!/usr/bin/perl |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
|
| 5 |
use MIME::Lite; |
| 6 |
use Test::More tests => 1; |
| 7 |
|
| 8 |
my @stupid_params = ( |
| 9 |
foo => 'bar', |
| 10 |
baz => [ qw(a b c d) ], |
| 11 |
[ qw(1 2 3 4) ], |
| 12 |
dog => 'cat', |
| 13 |
pig => { wookie => 2, snoozer => 2 }, |
| 14 |
{ x => 'y' }, |
| 15 |
); |
| 16 |
|
| 17 |
my %p = MIME::Lite->_unfold_stupid_params(@stupid_params); |
| 18 |
|
| 19 |
my $expected = { |
| 20 |
foo => 'bar', |
| 21 |
baz => [ qw(a b c d) ], |
| 22 |
|
| 23 |
1 => 2, |
| 24 |
3 => 4, |
| 25 |
|
| 26 |
dog => 'cat', |
| 27 |
pig => { wookie => 2, snoozer => 2 }, |
| 28 |
|
| 29 |
x => 'y', |
| 30 |
}; |
| 31 |
|
| 32 |
is_deeply(\%p, $expected, "we can rewrite stupid params"); |