mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
perl: add tests for 'extra bytes' exceptions
This commit is contained in:
parent
0a8a6ed168
commit
3d905a7a4f
1 changed files with 18 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue