summaryrefslogtreecommitdiff
path: root/perl/t
diff options
context:
space:
mode:
authortokuhirom <tokuhirom@gmail.com>2010-05-03 00:08:02 +0900
committertokuhirom <tokuhirom@gmail.com>2010-05-03 00:08:02 +0900
commit517ced2a54870e1c5aa9339d2483787477e529bd (patch)
tree0bbe782cdc3d1cbc77e513894e918f5d21e01597 /perl/t
parente57084f6dfa99e63542952a3fa39b0e75a1e66de (diff)
downloadmsgpack-python-517ced2a54870e1c5aa9339d2483787477e529bd.tar.gz
Perl: added more test case for streaming unpacker
Diffstat (limited to 'perl/t')
-rw-r--r--perl/t/06_stream_unpack2.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/perl/t/06_stream_unpack2.t b/perl/t/06_stream_unpack2.t
new file mode 100644
index 0000000..dc82c41
--- /dev/null
+++ b/perl/t/06_stream_unpack2.t
@@ -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;
+