From: Jarkko Hietaniemi Date: Wed, 1 May 2002 23:40:47 +0000 (+0000) Subject: Fix files.t for blead. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9508959b48d9beb1fd6a81c01ef5b8896339ebd4;p=p5sagit%2Fp5-mst-13.2.git Fix files.t for blead. p4raw-id: //depot/perl@16322 --- diff --git a/MANIFEST b/MANIFEST index 7086e1d..e39a324 100644 --- a/MANIFEST +++ b/MANIFEST @@ -169,6 +169,7 @@ ext/Digest/MD5/hints/irix_6.pl Hints for named architecture ext/Digest/MD5/Makefile.PL Digest::MD5 extension makefile writer ext/Digest/MD5/MD5.pm Digest::MD5 extension ext/Digest/MD5/MD5.xs Digest::MD5 extension +ext/Digest/MD5/README Digest::MD5 extension Readme ext/Digest/MD5/t/align.t See if Digest::MD5 extension works ext/Digest/MD5/t/badfile.t See if Digest::MD5 extension works ext/Digest/MD5/t/files.t See if Digest::MD5 extension works diff --git a/ext/Digest/MD5/README b/ext/Digest/MD5/README new file mode 100644 index 0000000..9ca4221 --- /dev/null +++ b/ext/Digest/MD5/README @@ -0,0 +1,14 @@ +The Digest::MD5 module allows you to use the RSA Data Security +Inc. MD5 Message Digest algorithm from within Perl programs. The +algorithm takes as input a message of arbitrary length and produces as +output a 128-bit "fingerprint" or "message digest" of the input. +MD5 is described in RFC 1321. + +You will need perl version 5.004 or better to install this module. + +Copyright 1998-2002 Gisle Aas. +Copyright 1995-1996 Neil Winton. +Copyright 1990-1992 RSA Data Security, Inc. + +This library is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. diff --git a/ext/Digest/MD5/t/files.t b/ext/Digest/MD5/t/files.t index b1abe19..5fcb035 100644 --- a/ext/Digest/MD5/t/files.t +++ b/ext/Digest/MD5/t/files.t @@ -1,3 +1,10 @@ +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + print "1..5\n"; use strict; @@ -6,13 +13,25 @@ use Digest::MD5 qw(md5 md5_hex md5_base64); # # This is the output of: 'md5sum Changes README MD5.pm MD5.xs rfc1321.txt' # -my $EXPECT = <updir; + while (@path) { + $path = File::Spec->catdir($path, shift @path); + } + $file = File::Spec->catfile($path, $file); + } +# print "# file = $file\n"; my $md5bin = pack("H*", $md5hex); my $md5b64; if ($B64) { @@ -37,14 +69,15 @@ for (split /^/, $EXPECT) { chop($md5b64); chop($md5b64); # remove padding } my $failed; + my $got; if (digest_file($file, 'digest') ne $md5bin) { print "$file: Bad digest\n"; $failed++; } - if (digest_file($file, 'hexdigest') ne $md5hex) { - print "$file: Bad hexdigest\n"; + if (($got = digest_file($file, 'hexdigest')) ne $md5hex) { + print "$file: Bad hexdigest: got $got expected $md5hex\n"; $failed++; }