5 use_ok 'SL::Request', qw(flatten unflatten);
 
   7 use constant DEBUG => 0;
 
  10   my $flat = flatten($_[0]);
 
  11   print Dumper($flat) if DEBUG;
 
  13   my $unflat = unflatten($flat);
 
  14   print Dumper($unflat) if DEBUG;
 
  16   cmp_deeply($flat, $_[1], $_[2]);
 
  17   cmp_deeply($unflat, $_[0], $_[2]);
 
  29 f { a => { b => 2 } },
 
  32 ], 'simple hash nesting';
 
  40 f { a => [ { c => 1, d => 2 }, { c => 3, d => 4 }, ] },
 
  48 # tests from Hash::Flatten below
 
  79 ), 'Hash::Flatten 2 - weird keys and values';
 
 105   [ 'y[+].baz' => 'bum',  ],
 
 106 ), 'Hash::Flatten 3 - mixed';
 
 115       'easily', [ 'parted', 'from' ], 'his'
 
 122  [ 'y[][]'    => 'his',    ],
 
 123  [ 'y[][+][]' => 'parted', ],
 
 124  [ 'y[][][]'  => 'from',   ],
 
 125  [ 'y[+][]'   => 'a',      ],
 
 126  [ 'y[+][]'   => 'easily', ],
 
 127  [ 'y[][]'    => 'fool',   ],
 
 129  [ 'y[]'      => 'money',  ],
 
 130 ), 'Hash::Flatten 4 - array nesting';
 
 152   [ 'y[+].baz' => 'bum', ],
 
 157 ), 'Hash::Flatten 5 - deep mix';