mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 21:18:23 +01:00
26 lines
540 B
Perl
26 lines
540 B
Perl
use strict;
|
|
use warnings;
|
|
use Data::MessagePack;
|
|
use Test::More tests => 6;
|
|
|
|
my $input = [(undef)x16];
|
|
my $packed = Data::MessagePack->pack($input);
|
|
is_deeply(Data::MessagePack->unpack($packed), $input);
|
|
|
|
{
|
|
my $up = Data::MessagePack::Unpacker->new();
|
|
$up->execute($packed, 0);
|
|
ok $up->is_finished;
|
|
is_deeply $up->data, $input;
|
|
}
|
|
|
|
{
|
|
my $up = Data::MessagePack::Unpacker->new();
|
|
is $up->execute(substr($packed, 0, 3), 0), 3;
|
|
$up->execute($packed, 3);
|
|
ok $up->is_finished;
|
|
is_deeply $up->data, $input;
|
|
}
|
|
|
|
|