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