perl: fixed stream deserializer in pp.

This commit is contained in:
tokuhirom
2010-09-18 09:44:32 +09:00
parent 953aa95c64
commit 2c9966a0a3
5 changed files with 57 additions and 25 deletions

View File

@@ -27,12 +27,14 @@ foreach my $size(1 .. 16) {
open my $stream, '<:bytes :scalar', \$packed;
binmode $stream;
my $buff;
my $done = 0;
while( read($stream, $buff, $size) ) {
#note "buff: ", join " ", map { unpack 'H2', $_ } split //, $buff;
$up->execute($buff);
$done = $up->execute($buff);
}
ok $up->is_finished, 'is_finished';
is $done, length($packed);
ok $up->is_finished, "is_finished: $size";
my $data = $up->data;
is_deeply $data, $input;
}