While minitest passes all its tests when everything has been
built, it is sometimes useful to run it when nothing has been
built but miniperl (especially when one is working on low-level
stuff that breaks miniperl). Many tests fail if things have
not been built yet because miniperl can’t find modules like
re.pm. This patch fixes up some tests to find those modules
and changes _charnames.pm to load File::Spec only when it
needs it.
There are still many more failures, but I’ll leave the rest
for another time (or another hacker :-).
package _charnames;
use strict;
use warnings;
-use File::Spec;
our $VERSION = '1.41';
use unicore::Name; # mktables-generated algorithmically-defined names
sub alias_file ($) # Reads a file containing alias definitions
{
+ require File::Spec;
my ($arg, $file) = @_;
if (-f $arg && File::Spec->file_name_is_absolute ($arg)) {
$file = $arg;
# Tests the scoping of $^H and %^H
BEGIN {
- @INC = qw(. ../lib);
+ @INC = qw(. ../lib ../ext/re);
chdir 't';
}
BEGIN {
chdir 't' if -d 't';
@INC = '.';
- push @INC, '../lib';
+ push @INC, '../lib', '../ext/re';
}
sub do_require {
BEGIN {
chdir 't' if -d 't';
- @INC = '../lib';
+ @INC = qw '../lib ../ext/re';
require './test.pl';
}
BEGIN {
chdir 't' if -d 't';
- @INC = ('../lib','.');
+ @INC = ('../lib','.','../ext/re');
require Config; import Config;
require './test.pl';
}
BEGIN {
chdir 't' if -d 't';
- @INC = '../lib';
+ @INC = qw '../lib ../ext/re';
require './test.pl';
eval 'require Config'; # assume defaults if this fails
}
BEGIN {
chdir 't' if -d 't';
- @INC = ('../lib','.');
+ @INC = ('../lib','.','../ext/re');
require './test.pl';
}
}
chdir 't' if -d 't';
- @INC = '../lib';
+ @INC = qw '../lib ../ext/re';
}