mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 21:18:23 +01:00
29 lines
486 B
Perl
29 lines
486 B
Perl
use t::Util;
|
|
use Test::More;
|
|
use Data::MessagePack;
|
|
|
|
plan tests => 6;
|
|
|
|
my $aref = [0];
|
|
$aref->[1] = $aref;
|
|
eval { Data::MessagePack->pack($aref) };
|
|
ok $@, $@;
|
|
|
|
my $href = {};
|
|
$href->{cycle} = $href;
|
|
eval { Data::MessagePack->pack($aref) };
|
|
ok $@, $@;
|
|
|
|
$aref = [0,[1,2]];
|
|
eval { Data::MessagePack->pack($aref) };
|
|
ok !$@;
|
|
|
|
eval { Data::MessagePack->pack($aref, 3) };
|
|
ok !$@;
|
|
|
|
eval { Data::MessagePack->pack($aref, 2) };
|
|
ok $@, $@;
|
|
|
|
eval { Data::MessagePack->pack($aref, -1) };
|
|
ok $@, $@;
|