1#!/usr/bin/perl -w 2 3BEGIN { 4 unshift @INC, 't/lib/'; 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} 28