ExtUtils::MakeMaker 6.55_02
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / cp.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = ('../lib', 'lib/');
7     }
8     else {
9         unshift @INC, 't/lib/';
10     }
11 }
12 chdir 't';
13
14 use ExtUtils::Command;
15 use Test::More tests => 1;
16
17 open FILE, ">source" or die $!;
18 print FILE "stuff\n";
19 close FILE;
20
21 # Instead of sleeping to make the file time older
22 utime time - 900, time - 900, "source";
23
24 END { 1 while unlink "source", "dest"; }
25
26 # Win32 bug, cp wouldn't update mtime.
27 {
28     local @ARGV = qw(source dest);
29     cp();
30     my $mtime = (stat("dest"))[9];
31     my $now   = time;
32     cmp_ok( abs($mtime - $now), '<=', 1, 'cp updated mtime' );
33 }