diff options
author | Andrew Fresh <afresh1@cvs.openbsd.org> | 2017-11-20 04:41:29 +0000 |
---|---|---|
committer | Andrew Fresh <afresh1@cvs.openbsd.org> | 2017-11-20 04:41:29 +0000 |
commit | 34b2426bebe64e5c631c80fada0a18b5e934cac4 (patch) | |
tree | 646ae869c3724f7bab3492a0abd7aa5420659f74 /gnu/usr.bin/perl/lib/File/Copy.t | |
parent | 0a305c368d765b4142a4b95d4348af71bfcc1e36 (diff) |
Support Time::HiRes::utime in File::Copy
Fixes issues with cross-device moves, noticed with autoconf
Diffstat (limited to 'gnu/usr.bin/perl/lib/File/Copy.t')
-rw-r--r-- | gnu/usr.bin/perl/lib/File/Copy.t | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gnu/usr.bin/perl/lib/File/Copy.t b/gnu/usr.bin/perl/lib/File/Copy.t index 9e49c7d3f08..5dd564dad29 100644 --- a/gnu/usr.bin/perl/lib/File/Copy.t +++ b/gnu/usr.bin/perl/lib/File/Copy.t @@ -24,6 +24,11 @@ BEGIN { *CORE::GLOBAL::rename = sub { CORE::rename($_[0], $_[1]) }; } use File::Copy qw(copy move cp); use Config; +# If we have Time::HiRes, File::Copy loaded it for us. +BEGIN { + eval { Time::HiRes->import(qw( stat utime )) }; + note "Testing Time::HiRes::utime support" unless $@; +} foreach my $code ("copy()", "copy('arg')", "copy('arg', 'arg', 'arg', 'arg')", "move()", "move('arg')", "move('arg', 'arg', 'arg')" @@ -100,7 +105,7 @@ for my $cross_partition_test (0..1) { ok -e "copy-$$", ' target still there'; # Doesn't really matter what time it is as long as its not now. - my $time = 1000000000; + my $time = 1000000000.12345; utime( $time, $time, "copy-$$" ); # Recheck the mtime rather than rely on utime in case we're on a |