Bump version and update Changes
[slob.git] / lib / Slob.pm
index 3e9697fff3c7c2faea0550ea579f1f4bc6848a33..9e7c5a119013345c73fdc3c944b00257af65081e 100644 (file)
@@ -3,7 +3,7 @@ package Slob;
 use 5.014000;
 use strict;
 use warnings;
-our $VERSION = '0.001';
+our $VERSION = '0.002_001';
 
 use constant MAGIC => "!-1SLOB\x1F";
 
@@ -14,6 +14,9 @@ use Compress::Raw::Bzip2;
 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 {
@@ -156,8 +159,14 @@ sub ftell {
 }
 
 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 {
@@ -363,7 +372,7 @@ Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2017 by Marius Gavrilescu
+Copyright (C) 2017-2018 by Marius Gavrilescu
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself, either Perl version 5.26.1 or,
This page took 0.010507 seconds and 4 git commands to generate.