+use lib 't';
use strict ;
use warnings ;
-use Compress::Zlib ;
+use Test::More ;
-sub ok
-{
- my ($no, $ok) = @_ ;
+BEGIN
+{
+ # use Test::NoWarnings, if available
+ my $extra = 0 ;
+ $extra = 1
+ if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
- #++ $total ;
- #++ $totalBad unless $ok ;
+ plan tests => 2 + $extra ;
- print "ok $no\n" if $ok ;
- print "not ok $no\n" unless $ok ;
- return $ok;
+ use_ok('Compress::Zlib', 2) ;
}
-print "1..1\n" ;
-
# Check zlib_version and ZLIB_VERSION are the same.
+
my $zlib_h = ZLIB_VERSION ;
my $libz = Compress::Zlib::zlib_version;
-ok(1, $zlib_h eq $libz) ||
-print <<EOM;
-# The version of zlib.h does not match the version of libz
-#
-# You have zlib.h version $zlib_h
-# and libz version $libz
-#
-# You probably have two versions of zlib installed on your system.
-# Try removing the one you don't want to use and rebuild.
+
+is($zlib_h, $libz, "ZLIB_VERSION ($zlib_h) matches Compress::Zlib::zlib_version")
+ or diag <<EOM;
+
+The version of zlib.h does not match the version of libz
+
+You have zlib.h version $zlib_h
+ and libz version $libz
+
+You probably have two versions of zlib installed on your system.
+Try removing the one you don't want to use and rebuild.
EOM