From: Dave Rolsky Date: Thu, 28 Oct 2010 21:57:14 +0000 (-0500) Subject: script to find tests with the same leading number X-Git-Tag: 1.18~27 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=db01aae11244e23fa2eed812ca1cfb8ed1dff22f;p=gitmo%2FMoose.git script to find tests with the same leading number --- diff --git a/author/find-dupe-test-numbers b/author/find-dupe-test-numbers new file mode 100755 index 0000000..ce975a0 --- /dev/null +++ b/author/find-dupe-test-numbers @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use File::Basename qw( basename ); + +for my $subdir ( glob 't/*' ) { + my %files; + + for my $file ( map { basename($_) } glob "$subdir/*.t" ) { + my ($number) = $file =~ /^(\d+)/; + next unless defined $number; + + push @{ $files{$number} }, $file; + } + + for my $number ( grep { @{ $files{$_} } > 1 } keys %files ) { + print $subdir, "\n"; + print ' - ', $_, "\n" for @{ $files{$number} }; + print "\n"; + } +}