This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Module-CoreList-5.20150912 is on the CPAN
[perl5.git] / cpan / ExtUtils-Command / t / cp.t
CommitLineData
8bdaab24
NC
1#!/usr/bin/perl -w
2
3BEGIN {
ca2a24a9 4 unshift @INC, 't/lib/';
8bdaab24
NC
5}
6chdir 't';
7
8use ExtUtils::Command;
9use Test::More tests => 1;
10
11open FILE, ">source" or die $!;
12print FILE "stuff\n";
13close FILE;
14
15# Instead of sleeping to make the file time older
16utime time - 900, time - 900, "source";
17
18END { 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}