mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-14 23:07:58 +02:00
Merge branch 'master' of git@github.com:msgpack/msgpack
This commit is contained in:
26
perl/t/06_stream_unpack2.t
Normal file
26
perl/t/06_stream_unpack2.t
Normal file
@@ -0,0 +1,26 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Data::MessagePack;
|
||||
use Test::More;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user