4 @INC = ("../lib", "lib/compress");
18 plan(skip_all => "lvalue sub tests need Perl ??")
21 # use Test::NoWarnings, if available
24 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
26 plan tests => 10 + $extra ;
28 use_ok('Compress::Zlib', 2) ;
38 my $len = length $hello ;
40 # Check zlib_version and ZLIB_VERSION are the same.
41 is Compress::Zlib::zlib_version, ZLIB_VERSION,
42 "ZLIB_VERSION matches Compress::Zlib::zlib_version" ;
46 title 'deflate/inflate with lvalue sub';
48 my $hello = "I am a HAL 9000 computer" ;
52 sub getData : lvalue { $data }
53 sub getX : lvalue { $X }
54 sub getZ : lvalue { $Z }
56 ok my $x = new Compress::Zlib::Deflate ( -AppendOutput => 1 );
58 cmp_ok $x->deflate(getData, getX), '==', Z_OK ;
60 cmp_ok $x->flush(getX), '==', Z_OK ;
62 my $append = "Appended" ;
65 ok my $k = new Compress::Zlib::Inflate ( -AppendOutput => 1 ) ;
67 cmp_ok $k->inflate(getX, getZ), '==', Z_STREAM_END ; ;