ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Compress-LZF/t/02_freeze.t
(Generate patch)

Comparing Compress-LZF/t/02_freeze.t (file contents):
Revision 1.4 by root, Thu Sep 27 20:09:06 2001 UTC vs.
Revision 1.5 by root, Tue Mar 26 17:49:24 2002 UTC

3 print "1..0 # skip Storable module unavailable\n"; 3 print "1..0 # skip Storable module unavailable\n";
4 exit; 4 exit;
5 }; 5 };
6} 6}
7 7
8BEGIN { $| = 1; print "1..1246\n"; } 8BEGIN { $| = 1; print "1..1959\n"; }
9 9
10END {print "not ok 1\n" unless $loaded;} 10END {print "not ok 1\n" unless $loaded;}
11use Compress::LZF ':freeze'; 11use Compress::LZF ':freeze';
12use Storable; 12use Storable;
13$loaded = 1; 13$loaded = 1;
26 my $nc = sfreeze_c $s; ok(1); 26 my $nc = sfreeze_c $s; ok(1);
27 my $r = sfreeze \$s; ok(1); 27 my $r = sfreeze \$s; ok(1);
28 my $rr = sfreeze_cr\$s; ok(1); 28 my $rr = sfreeze_cr\$s; ok(1);
29 my $rc = sfreeze_c \$s; ok(1); 29 my $rc = sfreeze_c \$s; ok(1);
30 30
31 ok ($n eq $nr);
32 ok (length ($n) >= length ($nc)); 31 ok (length ($n) >= length ($nc));
33 ok (length ($n) <= length ($r)); 32 ok (length ($n) <= length ($r));
34 ok (length ($r) >= length ($rr)); 33 ok (length ($r) >= length ($rr));
35 ok ($rr eq $rc); 34 ok ($rr eq $rc);
36 ok (length ($r) >= length ($rr)); 35 ok (length ($r) >= length ($rr));
44 ok ($s eq ${sthaw $rr}); 43 ok ($s eq ${sthaw $rr});
45 ok ($s eq ${sthaw $rc}); 44 ok ($s eq ${sthaw $rc});
46} 45}
47 46
48for my $pfx (0, 1, 4, 6, 7, 40, ord('x'), 240..255) { 47for my $pfx (0, 1, 4, 6, 7, 40, ord('x'), 240..255) {
48 chk $pfx;
49 $pfx =~ /(.*)/;
50 chk $1;
49 chk chr($pfx)."x"; 51 chk chr($pfx)."x";
50 chk chr($pfx)."xxxxxxxxxxxxx"; 52 chk chr($pfx)."xxxxxxxxxxxxx";
51 chk chr($pfx)."abcdefghijklm"; 53 chk chr($pfx)."abcdefghijklm";
52} 54}
53 55

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines