projects
/
slob.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
35224ef
)
Add debugging output
author
Marius Gavrilescu
<marius@ieval.ro>
Sat, 13 Jan 2018 19:52:56 +0000
(21:52 +0200)
committer
Marius Gavrilescu
<marius@ieval.ro>
Sat, 13 Jan 2018 19:52:56 +0000
(21:52 +0200)
lib/Slob.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Slob.pm
b/lib/Slob.pm
index 33516bd2e83f2afe105771ed779f6bb73e618f5d..9d7824991469615e88ee8128715618cdd9e30f60 100644
(file)
--- a/
lib/Slob.pm
+++ b/
lib/Slob.pm
@@
-14,6
+14,9
@@
use Compress::Raw::Bzip2;
use Compress::Raw::Lzma;
use Compress::Raw::Zlib;
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 {
our %UNCOMPRESS = (
'' => sub { $_[0] },
'lzma2' => sub {
@@
-156,8
+159,14
@@
sub ftell {
}
sub uncompress {
}
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 {
}
sub read_header {
This page took
0.010455 seconds
and
4
git commands to generate.