- ok ($result, $expectation, "running $prog");
-
- $expectation =~ s/Writing //; # remove leader
- foreach (split(/Writing /,$expectation)) {
- chomp; # remove \n
- if ($^O eq 'MacOS') {
- $_ = ':' . join(':',split(/\//,$_));
- $_ =~ s/$name:t:1.t/$name:t\/1.t/; # is this an h2xs bug?
+ is ($result, $expectation, "running $prog");
+
+ my (%got);
+ find (sub {$got{$File::Find::name}++ unless -d $_}, $name);
+
+ foreach ($expectation =~ /Writing\s+(\S+)/gm) {
+ if ($^O eq 'VMS') {
+ if ($Is_VMS_traildot) {
+ $_ .= '.' unless $_ =~ m/\./;
+ }
+ $_ = lc($_) unless exists $got{$_};
+ }
+ ok (-e $_, "check for $_") and delete $got{$_};
+ }
+ my @extra = keys %got;
+ unless (ok (!@extra, "Are any extra files present?")) {
+ print "# These files are unexpectedly present:\n";
+ print "# $_\n" foreach sort @extra;
+ }
+
+ chdir ($name) or die "chdir $name failed: $!";
+ # Aargh. Something wants to load a bit of regexp. And we have to chdir
+ # for ExtUtils::Manifest. Caught between a rock and a hard place, so this
+ # seems the least evil thing to do:
+ push @INC, "../../lib";
+ my ($missing, $extra) = ExtUtils::Manifest::fullcheck();
+ is_deeply ($missing, [], "No files in the MANIFEST should be missing");
+ is_deeply ($extra, [], "and all files present should be in the MANIFEST");
+ pop @INC;
+ chdir ($up) or die "chdir $up failed: $!";
+
+ if ($args =~ / \Q$header\E$/) {
+ my $const_c = File::Spec->catfile($name, 'fallback', 'const-c.inc');
+ my ($found, $diag);
+ if (!open FILE, '<', $const_c) {
+ $diag = "can't open $const_c: $!";
+ }
+ else {
+ while (<FILE>) {
+ next unless /\b Bactrian 2? \b/x;
+ $found = 1;
+ last;
+ }