This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
0b899bf87678d99137cf27d63d8dc56769b8e1c1
[perl5.git] / cpan / ExtUtils-MakeMaker / t / cp.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     unshift @INC, 't/lib/';
5 }
6 chdir 't';
7
8 use ExtUtils::Command;
9 use Test::More tests => 1;
10
11 open FILE, ">source" or die $!;
12 print FILE "stuff\n";
13 close FILE;
14
15 # Instead of sleeping to make the file time older
16 utime time - 900, time - 900, "source";
17
18 END { 1 while unlink "source", "dest"; }
19
20 # Win32 bug, cp wouldn't update mtime.
21 {
22     local @ARGV = qw(source dest);
23     cp();
24     my $mtime = (stat("dest"))[9];
25     my $now   = time;
26     cmp_ok( abs($mtime - $now), '<=', 1, 'cp updated mtime' );
27 }