4 use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
7 use_ok 'Module::Build';
8 ensure_blib('Module::Build');
11 my $tmp = MBTest->tmpdir;
14 my $dist = DistGen->new( dir => $tmp );
21 my $mb = Module::Build->new_from_context;
25 # Make sure copy_if_modified() can handle spaces in filenames
29 my $tmp = File::Spec->catdir('t', "tmp$_");
30 $mb->add_to_cleanup($tmp);
33 mkdir($tmp, 0777) or die "Can't create $tmp: $!";
39 my $filename = 'file with spaces.txt';
41 my $file = File::Spec->catfile($tmp[1], $filename);
42 my $fh = IO::File->new($file, '>') or die "Can't create $file: $!";
48 my $file2 = $mb->copy_if_modified(from => $file, to_dir => $tmp[2]);
54 # Try some dir_contains() combinations
55 my $first = File::Spec->catdir('', 'one', 'two');
56 my $second = File::Spec->catdir('', 'one', 'two', 'three');
58 ok( Module::Build->dir_contains($first, $second) );