ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Compress-LZV1/t/01_run.t
Revision: 1.1
Committed: Thu Sep 27 18:35:30 2001 UTC (22 years, 8 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: 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::LZV1;
4 $loaded = 1;
5 print "ok 1\n";
6
7 my $tst = 2;
8
9 for ("",
10 "x" x 100000,
11 rand().rand().rand() x 10000,
12 join "", map rand, 1..10000) {
13 my $compr1 = compress $_;
14 my $compr2 = compress $compr1;
15 my $uncompr1 = decompress $compr1;
16 my $compr3 = compress $_;
17 my $uncompr2 = decompress $compr2;
18 my $uncompr3 = decompress $uncompr2;
19
20 print length($compr1) <= length($_)+1 ? "" : "not ", "ok ", $tst++, "\n";
21 print length($compr2) <= length($compr1)+1 ? "" : "not ", "ok ", $tst++, "\n";
22 print length($compr3) <= length($_)+1 ? "" : "not ", "ok ", $tst++, "\n";
23 print $compr1 eq $compr3 ? "" : "not ", "ok ", $tst++, "\n";
24 print $uncompr1 eq $_ ? "" : "not ", "ok ", $tst++, "\n";
25 print $uncompr2 eq $compr1 ? "" : "not ", "ok ", $tst++, "\n";
26 print $uncompr3 eq $_ ? "" : "not ", "ok ", $tst++, "\n";
27 }