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 14BEGIN 15{ 16 # use Test::NoWarnings, if available 17 my $extra = 0 ; 18 $extra = 1 19 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; 20 21 22 my $VERSION = '2.204'; 23 my @NAMES = qw( 24 25 ); 26 27 my @OPT = qw( 28 29 ); 30 31 plan tests => 1 + @NAMES + @OPT + $extra ; 32 33 ok 1; 34 35 foreach my $name (@NAMES) 36 { 37 use_ok($name, $VERSION); 38 } 39 40 41 foreach my $name (@OPT) 42 { 43 eval " require $name " ; 44 if ($@) 45 { 46 ok 1, "$name not available" 47 } 48 else 49 { 50 my $ver = eval("\$${name}::VERSION"); 51 is $ver, $VERSION, "$name version should be $VERSION" 52 or diag "$name version is $ver, need $VERSION" ; 53 } 54 } 55 56} 57