public-inbox.git  about / heads / tags
an "archives first" approach to mailing lists
blob 0bb5091d8899c62cf416a46ebc5e768298dee877 679 bytes (raw)
$ git show HEAD:xt/check-debris.t	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
#!perl -w
use v5.12;
use autodie qw(open);
use PublicInbox::TestCommon;
use File::Spec;
my $tmpdir = File::Spec->tmpdir;

diag "note: writes to `$tmpdir' by others results in false-positives";

my %cur = map { $_ => 1 } glob("$tmpdir/*");
for my $t (@ARGV ? @ARGV : glob('t/*.t')) {
	open my $fh, '-|', $^X, '-w', $t;
	my @out;
	while (<$fh>) {
		chomp;
		push @out, $_;
		next if /^ok / || /\A[0-9]+\.\.[0-9]+\z/;
		diag $_;
	}
	ok(close($fh), $t) or diag(explain(\@out));

	no_coredump($tmpdir);

	my @remain = grep { !$cur{$_}++ } glob("$tmpdir/*");
	next if !@remain;
	is_deeply(\@remain, [], "$t has no leftovers") or
		diag "$t added: ",explain(\@remain);
}

done_testing;

git clone https://public-inbox.org/public-inbox.git
git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/public-inbox.git