mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-04-17 15:14:49 +02:00
perl: tests
This commit is contained in:
parent
fedc37d079
commit
ea36ef3107
@ -2,16 +2,14 @@ use strict;
|
||||
use Test::More;
|
||||
use Data::MessagePack;
|
||||
|
||||
foreach my $data("abc") {
|
||||
foreach my $data("abc", [42]) {
|
||||
my $packed = Data::MessagePack->pack($data);
|
||||
|
||||
my $unpacker = Data::MessagePack::Unpacker->new;
|
||||
note "buff: ", join " ", map { unpack 'H2', $_ } split //, $packed;
|
||||
|
||||
my $offset = 0;
|
||||
foreach my $byte(split //, $packed) {
|
||||
note "offset: $offset";
|
||||
$offset += $unpacker->execute($byte);
|
||||
$unpacker->execute($byte);
|
||||
}
|
||||
|
||||
ok $unpacker->is_finished, 'finished';
|
||||
|
Loading…
x
Reference in New Issue
Block a user