2023-07-20 18:44:02 +00:00
|
|
|
#!perl
|
2023-01-29 21:35:16 +00:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
2023-07-20 18:44:37 +00:00
|
|
|
use Test::More 'no_plan';
|
2023-01-29 21:35:16 +00:00
|
|
|
|
|
|
|
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/freed-bytes";
|
|
|
|
my @files = (
|
|
|
|
"$test_dir/1",
|
|
|
|
"$test_dir/2",
|
|
|
|
"$test_dir/3",
|
|
|
|
"$test_dir/4",
|
|
|
|
);
|
|
|
|
|
|
|
|
# Smoke test
|
2023-07-20 17:41:07 +00:00
|
|
|
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';
|
2023-01-29 21:35:16 +00:00
|
|
|
ok "freed 24 bytes (24 B)\n" eq $stderr, 'prints correct number of freed bytes';
|