2023-07-20 18:44:02 +00:00
|
|
|
#!perl
|
2023-01-29 21:35:16 +00:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use Test::Simple
|
|
|
|
tests => 3;
|
|
|
|
|
|
|
|
use TestFunctions;
|
|
|
|
|
2023-07-20 17:41:07 +00:00
|
|
|
my $tarball_dir = prep_tar();
|
2023-01-29 21:35:16 +00:00
|
|
|
my $test_dir = "$tarball_dir/t/sha1-collision";
|
|
|
|
my @files = (
|
|
|
|
"$test_dir/shattered-1.pdf",
|
|
|
|
"$test_dir/shattered-2.pdf",
|
|
|
|
);
|
|
|
|
|
|
|
|
# Smoke test
|
2023-07-20 17:41:07 +00:00
|
|
|
ok !are_hardlinked(@files), 'not hardlinked before we start';
|
|
|
|
run_script($test_dir);
|
|
|
|
ok file_exists(@files), 'files were not accidentally deleted';
|
|
|
|
ok !are_hardlinked(@files), 'files with the same SHA-1 hash did not get hardlinked';
|