use Compress::Raw::Lzma;
use Compress::Raw::Zlib;
+# MD5 only used for debugging output in tests
+use Digest::MD5 qw/md5_hex/;
+
our %UNCOMPRESS = (
'' => sub { $_[0] },
'lzma2' => sub {
}
sub uncompress {
- my ($self, $data) = @_;
- $UNCOMPRESS{$self->{header}{compression}}->($data)
+ my ($self, $data) = @_;
+ my $compression = $self->{header}{compression};
+ if ($ENV{HARNESS_ACTIVE} && $compression eq 'lzma2') {
+ my $prefix = unpack 'H*', substr $data, 0, 10;
+ my $md5sum = md5_hex $data;
+ Test::More::diag "Uncompressing data starting '$prefix', md5sum $md5sum";
+ }
+ $UNCOMPRESS{$compression}->($data)
}
sub read_header {