This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
POSIX.xs: Never pass NULL to ctermid()
[perl5.git] / cpan / IO-Compress / t / 000prereq.t
CommitLineData
319fab50
PM
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
PM
14sub gotScalarUtilXS
15{
16 eval ' use Scalar::Util "dualvar" ';
17 return $@ ? 0 : 1 ;
18}
19
319fab50
PM
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
72b8e1a2 28 my $VERSION = '2.093';
319fab50
PM
29 my @NAMES = qw(
30 Compress::Raw::Bzip2
31 Compress::Raw::Zlib
10c2b2bb
PM
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
PM
61 );
62
0fad139d 63 my @OPT = qw(
319fab50
PM
64 );
65
8dcc3739 66 plan tests => 1 + 2 + @NAMES + @OPT + $extra ;
319fab50
PM
67
68 foreach my $name (@NAMES)
69 {
70 use_ok($name, $VERSION);
71 }
72
73
74 foreach my $name (@OPT)
75 {
76 eval " require $name " ;
77 if ($@)
78 {
79 ok 1, "$name not available"
80 }
81 else
82 {
83 my $ver = eval("\$${name}::VERSION");
84 is $ver, $VERSION, "$name version should be $VERSION"
85 or diag "$name version is $ver, need $VERSION" ;
86 }
87 }
10c2b2bb 88
8dcc3739
CBW
89 # need zlib 1.2.0 or better
90
91 cmp_ok Compress::Raw::Zlib::ZLIB_VERNUM(), ">=", 0x1200
92 or diag "IO::Compress needs zlib 1.2.0 or better, you have " . Compress::Raw::Zlib::zlib_version();
93
10c2b2bb
PM
94 use_ok('Scalar::Util') ;
95
319fab50
PM
96}
97
10c2b2bb
PM
98ok gotScalarUtilXS(), "Got XS Version of Scalar::Util"
99 or diag <<EOM;
100You don't have the XS version of Scalar::Util
101EOM
102