Pingback::_touch should update the [ma]time of the file

This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-08-21 17:00:32 -03:00
parent 2d41598ea4
commit e5b99fb41c
2 changed files with 6 additions and 0 deletions

View File

@@ -176,6 +176,7 @@ sub _touch {
sysopen my $fh, $file, O_WRONLY|O_CREAT|O_NONBLOCK
or die "Cannot create $file : $!";
close $fh or die "Cannot close $file : $!";
utime(undef, undef, $file);
}
sub encode_client_response {

View File

@@ -215,6 +215,11 @@ ok(
"time_to_check returns true if the file exists and it's mtime is at least one day old",
);
ok(
!Pingback::time_to_check($file),
"...but fails if tried a second time, as the mtime has been updated",
);
# #############################################################################
# Done.
# #############################################################################