public
Created

  • Download Gist
mp.pl
Perl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#!perl
 
use strict;
use warnings;
 
use Data::MessagePack;
use Test::More;
 
my $data = {
'foo' => {
'a' => '',
'b' => '',
'c' => '',
'd' => '',
'e' => '',
'f' => '',
'g' => '',
}
};
 
use Data::Dumper;
$Data::Dumper::Useqq = 1;
 
my $packed1 = +Data::MessagePack->pack($data);
my $packed2 = +Data::MessagePack->pack(Data::MessagePack->unpack($packed1));
my $packed3 = +Data::MessagePack->pack(Data::MessagePack->unpack($packed2));
my $packed4 = +Data::MessagePack->pack(Data::MessagePack->unpack($packed3));
my $packed5 = +Data::MessagePack->pack(Data::MessagePack->unpack($packed4));
 
is $packed1, $packed2;
is $packed1, $packed3;
is $packed1, $packed4;
is $packed1, $packed5;
 
done_testing;

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.