Flipped checkcase.pl from a porting tool to an actual test file
Jesse Vincent [Sat, 1 Aug 2009 17:41:40 +0000 (18:41 +0100)]
MANIFEST
t/porting/checkcase.t [moved from Porting/checkcase.pl with 63% similarity]

index 3f5cf85..532c95f 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -3752,7 +3752,6 @@ Porting/check83.pl        Check whether we are 8.3-friendly
 Porting/checkansi.pl   Check source code for ANSI-C violations
 Porting/checkARGS_ASSERT.pl    Check we use every PERL_ARGS_ASSERT* macro
 Porting/checkAUTHORS.pl        Check that the AUTHORS file is complete
-Porting/checkcase.pl   Check whether we are case-insensitive-fs-friendly
 Porting/checkcfgvar.pl Check that config scripts define all symbols
 Porting/checkURL.pl    Check whether we have working URLs
 Porting/checkVERSION.pl        Check whether we have $VERSIONs
@@ -4385,6 +4384,7 @@ t/pod/testpods/lib/Pod/Stuff.pm           Sample data for t/pod/find.t
 t/pod/twice.t                  Test Pod::Parser
 t/pod/usage2.pod               Test POD for pod2usage tests
 t/pod/usage.pod                        Test POD for pod2usage tests
+t/porting/checkcase.t  Check whether we are case-insensitive-fs-friendly
 t/README                       Instructions for regression tests
 t/run/cloexec.t                        Test close-on-exec.
 t/run/exit.t                   Test perl's exit status.
similarity index 63%
rename from Porting/checkcase.pl
rename to t/porting/checkcase.t
index 66dccd2..82be050 100644 (file)
@@ -2,11 +2,20 @@
 # Finds the files that have the same name, case insensitively,
 # in the current directory and its subdirectories
 
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = '../lib';
+}
+
+
+
 use warnings;
 use strict;
 use File::Find;
 
 my %files;
+my $test_count = 0;
+
 find(sub {
           my $name = $File::Find::name;
           # Assumes that the path separator is exactly one character.
@@ -18,9 +27,10 @@ my $failed;
 
 foreach (values %files) {
     if (@$_ > 1) {
-       print join(", ", @$_), "\n";
-       $failed++;
-    }
+               print "not ok ".++$test_count. " - ". join(", ", @$_), "\n";
+    } else {
+               print "ok ".++$test_count. " - ". join(", ", @$_), "\n";
+       }
 }
 
-print "no similarly named files found\n" unless $failed;
+print "1..".$test_count."\n";