simplify_static_dir/t/timestamp-preservation.t

23 lines
597 B
Perl
Raw Normal View History

#!perl
use strict;
use warnings;
2023-07-20 18:44:37 +00:00
use Test::More 'no_plan';
use TestFunctions;
2023-07-20 17:41:07 +00:00
my $tarball_dir = prep_tar();
my $test_dir = "$tarball_dir/t/timestamp-preservation";
my @files = (
"$test_dir/newer-more-linked",
"$test_dir/older-less-linked",
);
# Smoke test
2023-07-20 17:41:07 +00:00
ok !are_hardlinked(@files), 'not hardlinked before we start';
my $should_have_mtime = filemtime($files[1]);
run_script($test_dir);
ok file_exists(@files), 'files were not accidentally deleted';
2023-07-20 19:30:23 +00:00
ok are_hardlinked(@files), 'files should be hardlinked';
2023-07-20 17:41:07 +00:00
ok has_mtime($should_have_mtime, @files), 'timestamps updated to use oldest';