mirror of
https://codeberg.org/h3xx/simplify_static_dir
synced 2024-08-14 23:57:24 +00:00
22a7b86113
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.
26 lines
636 B
Perl
26 lines
636 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/freed-bytes";
|
|
my @files = (
|
|
"$test_dir/1",
|
|
"$test_dir/2",
|
|
"$test_dir/3",
|
|
"$test_dir/4",
|
|
);
|
|
|
|
# Smoke test
|
|
ok !&are_hardlinked(@files), 'not hardlinked before we start';
|
|
my (undef, $stdout, $stderr) = &run_script_capture('-f', $test_dir, $test_dir);
|
|
ok &file_exists(@files), 'files were not accidentally deleted';
|
|
ok "freed 24 bytes (24 B)\n" eq $stderr, 'prints correct number of freed bytes';
|