Skip to content

Instantly share code, notes, and snippets.

@cho45
Created August 17, 2011 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cho45/1150774 to your computer and use it in GitHub Desktop.
Save cho45/1150774 to your computer and use it in GitHub Desktop.
#!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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment