simplify_static_dir/t/sha1collision-non-linkage.t
Dan Church 22a7b86113
CI: Replace shell script tests with TAP harness
During all this I uncovered a bug in how Archive::Tar handles sparse
files stored in tarballs; the library reports the file as having no
contents and a size of 0. As a result, in the freed-bytes-commas test,
the tarball extraction has been replaced by on-the-fly file creation.
2023-01-29 15:39:25 -06:00

24 lines
578 B
Perl

#!/usr/bin/perl
# vi: et sts=4 sw=4 ts=4
use strict;
use warnings;
use Test::Simple
tests => 3;
use FindBin qw//;
use lib $FindBin::RealBin;
use TestFunctions;
my $tarball_dir = &prep_tar;
my $test_dir = "$tarball_dir/t/sha1-collision";
my @files = (
"$test_dir/shattered-1.pdf",
"$test_dir/shattered-2.pdf",
);
# Smoke test
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';