4 use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
9 my $tmp = MBTest->tmpdir;
12 my $dist = DistGen->new( dir => $tmp );
15 chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!";
22 my $mb = Module::Build->new_from_context;
26 # Make sure copy_if_modified() can handle spaces in filenames
30 my $tmp = File::Spec->catdir('t', "tmp$_");
31 $mb->add_to_cleanup($tmp);
34 mkdir($tmp, 0777) or die "Can't create $tmp: $!";
40 my $filename = 'file with spaces.txt';
42 my $file = File::Spec->catfile($tmp[1], $filename);
43 my $fh = IO::File->new($file, '>') or die "Can't create $file: $!";
49 my $file2 = $mb->copy_if_modified(from => $file, to_dir => $tmp[2]);
55 # Try some dir_contains() combinations
56 my $first = File::Spec->catdir('', 'one', 'two');
57 my $second = File::Spec->catdir('', 'one', 'two', 'three');
59 ok( Module::Build->dir_contains($first, $second) );
63 chdir( $cwd ) or die "Can''t chdir to '$cwd': $!";