Upgrade to Compress::Zlib 2.000_05
[p5sagit/p5-mst-13.2.git] / ext / Compress / Zlib / t / 01version.t
index ea5b6a0..bdb8a9a 100644 (file)
@@ -1,34 +1,36 @@
 
+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