ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/t/99_binary.t
(Generate patch)

Comparing JSON-XS/t/99_binary.t (file contents):
Revision 1.2 by root, Wed Dec 5 10:59:31 2007 UTC vs.
Revision 1.3 by root, Sat Jan 10 20:05:40 2009 UTC

29 ok ($_[0] eq JSON::XS->new->decode ($js)->[0], 6); 29 ok ($_[0] eq JSON::XS->new->decode ($js)->[0], 6);
30 $js = JSON::XS->new->allow_nonref(0)->encode ([$_[0]]); 30 $js = JSON::XS->new->allow_nonref(0)->encode ([$_[0]]);
31 ok ($_[0] eq JSON::XS->new->shrink->decode ($js)->[0], 7); 31 ok ($_[0] eq JSON::XS->new->shrink->decode ($js)->[0], 7);
32} 32}
33 33
34srand 0; # doesn't help too much, but its at leats more deterministic 34srand 0; # doesn't help too much, but its at least more deterministic
35 35
36for (1..768) { 36for (1..768) {
37 test join "", map chr ($_ & 255), 0..$_; 37 test join "", map chr ($_ & 255), 0..$_;
38 test join "", map chr rand 255, 0..$_; 38 test join "", map chr rand 255, 0..$_;
39 test join "", map chr ($_ * 97 & ~0x4000), 0..$_; 39 test join "", map chr ($_ * 97 & ~0x4000), 0..$_;
40 test join "", map chr (rand (2**20) & ~0x800), 0..$_; 40 test join "", map chr (rand (2**20) & ~0x800), 0..$_;
41} 41}
42

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines