Move IO::Compress from ext/ to cpan/
[p5sagit/p5-mst-13.2.git] / cpan / IO-Compress / t / 000prereq.t
CommitLineData
319fab50 1BEGIN {
2 if ($ENV{PERL_CORE}) {
3 chdir 't' if -d 't';
4 @INC = ("../lib", "lib/compress");
5 }
6}
7
8use lib qw(t t/compress);
9use strict ;
10use warnings ;
11
12use Test::More ;
13
10c2b2bb 14sub gotScalarUtilXS
15{
16 eval ' use Scalar::Util "dualvar" ';
17 return $@ ? 0 : 1 ;
18}
19
319fab50 20BEGIN
21{
22 # use Test::NoWarnings, if available
23 my $extra = 0 ;
24 $extra = 1
25 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
26
27
10c2b2bb 28 my $VERSION = '2.021';
319fab50 29 my @NAMES = qw(
30 Compress::Raw::Bzip2
31 Compress::Raw::Zlib
10c2b2bb 32
33 Compress::Zlib
34
35 IO::Compress::Adapter::Bzip2
36 IO::Compress::Adapter::Deflate
37 IO::Compress::Adapter::Identity
38 IO::Compress::Base::Common
39 IO::Compress::Base
40 IO::Compress::Bzip2
41 IO::Compress::Deflate
42 IO::Compress::Gzip::Constants
43 IO::Compress::Gzip
44 IO::Compress::RawDeflate
45 IO::Compress::Zip::Constants
46 IO::Compress::Zip
47 IO::Compress::Zlib::Constants
48 IO::Compress::Zlib::Extra
49 IO::Uncompress::Adapter::Bunzip2
50 IO::Uncompress::Adapter::Identity
51 IO::Uncompress::Adapter::Inflate
52 IO::Uncompress::AnyInflate
53 IO::Uncompress::AnyUncompress
54 IO::Uncompress::Base
55 IO::Uncompress::Bunzip2
56 IO::Uncompress::Gunzip
57 IO::Uncompress::Inflate
58 IO::Uncompress::RawInflate
59 IO::Uncompress::Unzip
60
319fab50 61 );
62
63 my @OPT = qw(
64
65 );
66
10c2b2bb 67 plan tests => 2 + @NAMES + @OPT + $extra ;
319fab50 68
69 foreach my $name (@NAMES)
70 {
71 use_ok($name, $VERSION);
72 }
73
74
75 foreach my $name (@OPT)
76 {
77 eval " require $name " ;
78 if ($@)
79 {
80 ok 1, "$name not available"
81 }
82 else
83 {
84 my $ver = eval("\$${name}::VERSION");
85 is $ver, $VERSION, "$name version should be $VERSION"
86 or diag "$name version is $ver, need $VERSION" ;
87 }
88 }
10c2b2bb 89
90 use_ok('Scalar::Util') ;
91
319fab50 92}
93
10c2b2bb 94ok gotScalarUtilXS(), "Got XS Version of Scalar::Util"
95 or diag <<EOM;
96You don't have the XS version of Scalar::Util
97EOM
98