mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-30 07:26:29 +02:00
perl: add tests for 'extra bytes' exceptions
This commit is contained in:
parent
0a8a6ed168
commit
3d905a7a4f
18
perl/t/14_invalid_data.t
Executable file
18
perl/t/14_invalid_data.t
Executable file
@ -0,0 +1,18 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Data::MessagePack;
|
||||
use Test::More;
|
||||
use t::Util;
|
||||
|
||||
my $nil = Data::MessagePack->pack(undef);
|
||||
|
||||
my @data = do 't/data.pl';
|
||||
while(my($dump, $data) = splice @data, 0, 2) {
|
||||
my $s = Data::MessagePack->pack($data);
|
||||
eval {
|
||||
Data::MessagePack->unpack($s . $nil);
|
||||
};
|
||||
like $@, qr/extra bytes/, "dump $dump";
|
||||
}
|
||||
|
||||
done_testing;
|
Loading…
x
Reference in New Issue
Block a user