[libpath-tiny-perl] 06/11: Add Digest and Digest::SHA prereqs
Jonas Smedegaard
js at alioth.debian.org
Wed Aug 7 16:10:30 UTC 2013
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libpath-tiny-perl.
commit addce47be96253b353a79a2b3fce84aa04ecbeee
Author: David Golden <dagolden at cpan.org>
Date: Thu Jul 25 19:26:32 2013 -0400
Add Digest and Digest::SHA prereqs
Perl 5.10.0 is fine, but earlier Perls need versions
that support SHA-256. With prereqs added, I removed
the skip logic from the digest tests.
---
dist.ini | 3 +++
t/digest.t | 36 +++++++++++++-----------------------
2 files changed, 16 insertions(+), 23 deletions(-)
diff --git a/dist.ini b/dist.ini
index 5dc3c57..d5a4e75 100644
--- a/dist.ini
+++ b/dist.ini
@@ -35,7 +35,10 @@ stopwords = utf
remove = Unicode::UTF8
remove = Path::Class
+; Digest/Digest::SHA are fine in 5.10.0+
[Prereqs]
+Digest = 1.03
+Digest::SHA = 5.45
File::Path = 2.07
File::Temp = 0.18
diff --git a/t/digest.t b/t/digest.t
index 451e58d..054cc70 100644
--- a/t/digest.t
+++ b/t/digest.t
@@ -12,29 +12,19 @@ my $file = $dir->child('foo.bin');
my $chunk = pack("Z*", "Hello Path::Tiny\nThis is packed binary string\n");
ok( $file->spew_raw($chunk), "created test file with packed binary string" );
-# Digest::SHA was first released with perl v5.9.3.
-# And Digest::SHA2 is not a core module.
-SKIP: {
- eval { require Digest::SHA; 1 };
- if ($@) {
- eval { require Digest::SHA2; 1 };
- skip "cannot find neither Digest::SHA nor Digest::SHA2", 1 if $@;
- }
-
- is(
- $file->digest,
- 'a98e605049836e8adb36d351abb95a09e9e5e200703576ecdaec0e697d17d626',
- 'digest SHA-256 (hardcoded)',
- );
-
- my $sha = Digest->new('SHA-256');
- $sha->add($chunk);
- is(
- $file->digest,
- $sha->hexdigest,
- 'digest SHA-256',
- );
-}
+is(
+ $file->digest,
+ 'a98e605049836e8adb36d351abb95a09e9e5e200703576ecdaec0e697d17d626',
+ 'digest SHA-256 (hardcoded)',
+);
+
+my $sha = Digest->new('SHA-256');
+$sha->add($chunk);
+is(
+ $file->digest,
+ $sha->hexdigest,
+ 'digest SHA-256',
+);
is(
$file->digest('MD5'),
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libpath-tiny-perl.git
More information about the Pkg-perl-cvs-commits
mailing list