ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Compress-LZF/t/01_run.t
Revision: 1.1
Committed: Thu Sep 27 18:36:37 2001 UTC (22 years, 8 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-3_7, rel-1_9, rel-1_71, rel-3_4, rel-3_1, rel-1_8, rel-1_5, rel-2_0, rel-3_8, rel-3_41, rel-3_42, rel-3_43, rel-1_7, rel-3_11, HEAD
Log Message:
*** empty log message ***

File Contents

# Content
1 BEGIN { $| = 1; print "1..29\n"; }
2 END {print "not ok 1\n" unless $loaded;}
3 use Compress::LZF;
4 $loaded = 1;
5 print "ok 1\n";
6
7 my $tst = 2;
8
9 for ("",
10 "x" x 10000,
11 rand().rand().rand() x 10000,
12 join "", map rand, 1..10000
13 ) {
14 my $compr1 = compress $_;
15 my $compr2 = compress $compr1;
16 my $uncompr1 = decompress $compr1;
17 my $compr3 = compress $_;
18 my $uncompr2 = decompress $compr2;
19 my $uncompr3 = decompress $uncompr2;
20
21 print length($compr1) <= length($_)+1 ? "" : "not ", "ok ", $tst++, "\n";
22 print length($compr2) <= length($compr1)+1 ? "" : "not ", "ok ", $tst++, "\n";
23 print length($compr3) <= length($_)+1 ? "" : "not ", "ok ", $tst++, "\n";
24 print $compr1 eq $compr3 ? "" : "not ", "ok ", $tst++, "\n";
25 print $uncompr1 eq $_ ? "" : "not ", "ok ", $tst++, "\n";
26 print $uncompr2 eq $compr1 ? "" : "not ", "ok ", $tst++, "\n";
27 print $uncompr3 eq $_ ? "" : "not ", "ok ", $tst++, "\n";
28 }