Commit | Line | Data |
772ab650 |
1 | #!/usr/bin/perl |
2 | # Finds the files that have the same name, case insensitively, |
3 | # in the current directory and its subdirectories |
4 | |
5 | use warnings; |
6 | use strict; |
7 | use File::Find; |
8 | |
9 | my %files; |
bf61c852 |
10 | my $test_count = 0; |
11 | |
772ab650 |
12 | find(sub { |
13 | my $name = $File::Find::name; |
14 | # Assumes that the path separator is exactly one character. |
15 | $name =~ s/^\.\..//; |
0a38ae18 |
16 | |
17 | # Special exemption for Makefile, makefile |
18 | return if $name =~ m!\A(?:x2p/)?[Mm]akefile\z!; |
19 | |
772ab650 |
20 | push @{$files{lc $name}}, $name; |
85ee66eb |
21 | }, '..'); |
772ab650 |
22 | |
772ab650 |
23 | foreach (values %files) { |
24 | if (@$_ > 1) { |
bf61c852 |
25 | print "not ok ".++$test_count. " - ". join(", ", @$_), "\n"; |
26 | } else { |
27 | print "ok ".++$test_count. " - ". join(", ", @$_), "\n"; |
28 | } |
772ab650 |
29 | } |
30 | |
bf61c852 |
31 | print "1..".$test_count."\n"; |