ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CBOR-XS/t/57_incr.t
(Generate patch)

Comparing CBOR-XS/t/57_incr.t (file contents):
Revision 1.3 by root, Tue Dec 10 14:53:18 2013 UTC vs.
Revision 1.4 by root, Tue Dec 10 15:31:40 2013 UTC

6my $tst = 1; 6my $tst = 1;
7 7
8sub tst($$) { 8sub tst($$) {
9 my ($cbor, $correct) = @_; 9 my ($cbor, $correct) = @_;
10 10
11 my $dec = CBOR::XS->new;
12
11 # chop 13 # chop
12 for my $step (1 .. length $cbor) { 14 for my $step (1 .. length $cbor) {
13 my $dec = CBOR::XS->new;
14 my $buf = ""; 15 my $buf = "";
15 my @cbor; 16 my @cbor;
16 17
18 $dec->incr_reset;
19
17 for (unpack "(a$step)*", $cbor) { 20 for (unpack "(a$step)*", $cbor) {
18 $buf .= $_; 21 $buf .= $_;
19 push @cbor, $dec->incr_parse ($buf); 22 push @cbor, $dec->incr_parse_multiple ($buf);
20 } 23 }
21 24
22 print length $buf ? "not " : "", "ok ", ++$tst, "\n"; 25 print length $buf ? "not " : "", "ok ", ++$tst, "\n";
23 26
24 my $enc = join " ", map +(unpack "H*", encode_cbor $_), @cbor; 27 my $enc = join " ", map +(unpack "H*", encode_cbor $_), @cbor;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines