+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ }
+}
+
print "1..3\n";
use strict;
# (You'll need to have Perl 5.7.3 or later, to have the Encode installed.)
# (And remember that under the Perl core distribution you should
# also have the $ENV{PERL_CORE} set to a true value.)
-# Similarly, to update MacOS section, run with $ENV{MAC_MD5SUM} set.
my $EXPECT;
if (ord "A" == 193) { # EBCDIC
$EXPECT = <<EOT;
11e8028ee426273db6b6db270a8bb38c README
-6e556382813f67120863f4f91b7fcdc2 MD5.xs
+c13b305ff761095dea11ea1e74e5c7ec MD5.xs
276da0aa4e9a08b7fe09430c9c5690aa rfc1321.txt
EOT
-} elsif ("\n" eq "\015") { # MacOS
- $EXPECT = <<EOT;
-c95549c6c5e1e1c078b27042f1dc850f README
-7aa380c810bc7c1a0bec22cf32bc50d4 MD5.xs
-754b9db19f79dbc4992f7166eb0f37ce rfc1321.txt
-EOT
} else {
# This is the output of: 'md5sum README MD5.xs rfc1321.txt'
$EXPECT = <<EOT;
c95549c6c5e1e1c078b27042f1dc850f README
-7aa380c810bc7c1a0bec22cf32bc50d4 MD5.xs
+4ae6c261478df35a192cc1bdffd5211f MD5.xs
754b9db19f79dbc4992f7166eb0f37ce rfc1321.txt
EOT
}
print "ok ", ++$testno, " # Skip: PERL_CORE\n";
next;
}
+ use File::Spec;
+ my @path = qw(ext Digest-MD5);
+ my $path = File::Spec->updir;
+ while (@path) {
+ $path = File::Spec->catdir($path, shift @path);
+ }
+ $file = File::Spec->catfile($path, $file);
}
# print "# file = $file\n";
unless (-f $file) {
print md5_hex($data), " $base\n";
next;
}
- if ($ENV{MAC_MD5SUM}) {
- require Encode;
- my $data = cat_file($file);
- Encode::from_to($data, 'latin1', 'MacRoman');
- print md5_hex($data), " $base\n";
- next;
- }
my $md5bin = pack("H*", $md5hex);
my $md5b64;
if ($B64) {