Blob Blame History Raw
diff -up Compress-Raw-Zlib-2.101/t/02zlib.t.orig Compress-Raw-Zlib-2.101/t/02zlib.t
--- Compress-Raw-Zlib-2.101/t/02zlib.t.orig	2020-05-30 16:28:44.000000000 +0200
+++ Compress-Raw-Zlib-2.101/t/02zlib.t	2022-08-23 07:49:13.175194632 +0200
@@ -1,3 +1,4 @@
+#!/usr/bin/perl
 BEGIN {
     if ($ENV{PERL_CORE}) {
 	chdir 't' if -d 't';
@@ -13,6 +14,7 @@ use bytes;
 use Test::More  ;
 use CompTestUtils;
 
+use constant ZLIB_1_2_12_0 => 0x12C0;
 
 BEGIN
 {
@@ -490,7 +492,16 @@ SKIP:
         last if $status == Z_STREAM_END or $status != Z_OK ;
     }
 
-    cmp_ok $status, '==', Z_DATA_ERROR ;
+    # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib
+    if (ZLIB_VERNUM >= ZLIB_1_2_12_0)
+    {
+        cmp_ok $status, '==', Z_STREAM_END ;
+    }
+    else
+    {
+        cmp_ok $status, '==', Z_DATA_ERROR ;
+    }
+
     is $GOT, $goodbye ;
 
 
@@ -514,7 +525,17 @@ SKIP:
     is length($rest), $len2, "expected compressed output";
 
     $GOT = '';
-    cmp_ok $k->inflate($rest, $GOT), '==', Z_DATA_ERROR, "inflate returns Z_DATA_ERROR";
+    $status = $k->inflate($rest, $GOT);
+    # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib
+    if (ZLIB_VERNUM >= ZLIB_1_2_12_0)
+    {
+        cmp_ok $status, '==', Z_STREAM_END ;
+    }
+    else
+    {
+        cmp_ok $status, '==', Z_DATA_ERROR ;
+    }
+
     is $GOT, $goodbye ;
 }