mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-06 17:59:52 +00:00
Perl: added more test case for streaming unpacker
This commit is contained in:
parent
e57084f6df
commit
517ced2a54
1 changed files with 26 additions and 0 deletions
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;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue