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.4 by root, Tue Dec 10 15:31:40 2013 UTC vs.
Revision 1.5 by root, Sun Jan 5 14:54:46 2014 UTC

1BEGIN { $| = 1; print "1..141\n"; } 1BEGIN { $| = 1; print "1..123\n"; }
2 2
3use CBOR::XS; 3use CBOR::XS;
4 4
5print "ok 1\n"; 5print "ok 1\n";
6my $tst = 1; 6my $tst = 1;
24 24
25 print length $buf ? "not " : "", "ok ", ++$tst, "\n"; 25 print length $buf ? "not " : "", "ok ", ++$tst, "\n";
26 26
27 my $enc = join " ", map +(unpack "H*", encode_cbor $_), @cbor; 27 my $enc = join " ", map +(unpack "H*", encode_cbor $_), @cbor;
28 28
29 print $enc eq $correct ? "" : "not ", "ok ", ++$tst, " # $enc eq $correct\n"; 29 print $enc eq $correct ? "" : "not ", "ok ", ++$tst, " # ($step) $enc eq $correct\n";
30 } 30 }
31} 31}
32 32
33sub err($$) { 33sub err($$) {
34 if (eval { CBOR::XS->new->max_size (1e3)->incr_parse ($_[0]); 1 }) { 34 if (eval { CBOR::XS->new->max_size (1e3)->incr_parse ($_[0]); 1 }) {
40 } 40 }
41} 41}
42 42
43tst "\x81\x82\x81\x80\x80\x80", "8182818080 80"; 43tst "\x81\x82\x81\x80\x80\x80", "8182818080 80";
44tst "\x01\x18\x55\x01", "01 1855 01"; 44tst "\x01\x18\x55\x01", "01 1855 01";
45tst "\x18\x01\x19\x02\x02\x1a\x04\x04\x04\x04\x1b\x08\x08\x08\x08\x08\x08\x08\x08\x00", "01 190202 1a04040404 1b0808080808080808 00"; 45#tst "\x18\x01\x19\x02\x02\x1a\x04\x04\x04\x04\x1b\x08\x08\x08\x08\x08\x08\x08\x08\x00", "01 190202 1a04040404 1b0808080808080808 00";
46tst "\x18\x01\x19\x02\x02\x1a\x04\x04\x04\x04\x00", "01 190202 1a04040404 00";
46tst "\x41A\x42CD", "4141 424344"; 47tst "\x41A\x42CD", "4141 424344";
47tst "\x58\x01A\x59\x00\x01B\x5a\x00\x00\x00\x01C\x5b\x00\x00\x00\x00\x00\x00\x00\x02XY\x01", "4141 4142 4143 425859 01"; 48tst "\x58\x01A\x59\x00\x01B\x5a\x00\x00\x00\x01C\x5b\x00\x00\x00\x00\x00\x00\x00\x02XY\x01", "4141 4142 4143 425859 01";
48tst "\x5f\x41A\x41B\x42CD\xff", "4441424344"; 49tst "\x5f\x41A\x41B\x42CD\xff", "4441424344";
49err "\xff", "major 7"; 50err "\xff", "major 7";
50err "\x5a\xff\x00\x00\x00", "max_size"; 51err "\x5a\xff\x00\x00\x00", "max_size";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines