develooper Front page | perl.perl5.changes | Postings from July 2009

[perl.git] branch blead, updated. GitLive-blead-1709-g398f002

From:
Nicholas Clark
Date:
July 29, 2009 09:03
Subject:
[perl.git] branch blead, updated. GitLive-blead-1709-g398f002
Message ID:
E1MWBch-0002S1-8O@camel.booking.com
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/398f002c97feb32fa5d70119ed06988021e19663?hp=5bd03515d294382b9bededef5a3bb4cd415656c3>

- Log -----------------------------------------------------------------
commit 398f002c97feb32fa5d70119ed06988021e19663
Author: Nicholas Clark <nick@ccl4.org>
Date:   Wed Jul 29 16:32:56 2009 +0100

    Add a test to verify that the MANIFEST file is well-formed.
-----------------------------------------------------------------------

Summary of changes:
 MANIFEST         |    1 +
 t/lib/manifest.t |   44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 0 deletions(-)
 create mode 100644 t/lib/manifest.t

diff --git a/MANIFEST b/MANIFEST
index b4e4af2..9d5370f 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -4052,6 +4052,7 @@ t/lib/MakeMaker/Test/Setup/Problem.pm	MakeMaker test utilities
 t/lib/MakeMaker/Test/Setup/Recurs.pm	MakeMaker test utilities
 t/lib/MakeMaker/Test/Setup/XS.pm	MakeMaker test utilities
 t/lib/MakeMaker/Test/Utils.pm	MakeMaker test utilities
+t/lib/manifest.t		Test that this MANIFEST file is well formed
 t/lib/Math/BigFloat/Subclass.pm	Empty subclass of BigFloat for test
 t/lib/Math/BigInt/BareCalc.pm	Bigint's simulation of Calc
 t/lib/Math/BigInt/Scalar.pm	Pure Perl module to support Math::BigInt
diff --git a/t/lib/manifest.t b/t/lib/manifest.t
new file mode 100644
index 0000000..a98e974
--- /dev/null
+++ b/t/lib/manifest.t
@@ -0,0 +1,44 @@
+#!./perl -w
+
+# Test the well formed-ness of the MANIFEST file.
+# For now, just test that it uses tabs not spaces after the name of the file.
+
+BEGIN {
+    chdir 't';
+    @INC = '../lib';
+}
+
+use strict;
+use File::Spec;
+require './test.pl';
+
+my $failed = 0;
+
+plan('no_plan');
+
+my $manifest = File::Spec->catfile(File::Spec->updir(), 'MANIFEST');
+
+open my $m, '<', $manifest or die "Can't open '$manifest': $!";
+
+while (<$m>) {
+    chomp;
+    next unless /\s/;
+    my ($file, $separator) = /^(\S+)(\s+)/;
+    isnt($file, undef, "Line $. doesn't start with a blank") or next;
+    if ($separator !~ tr/\t//c) {
+	# It's all tabs
+	next;
+    } elsif ($separator !~ tr/ //c) {
+	# It's all spaces
+	fail("Spaces in entry for $file");
+	next;
+    } elsif ($separator =~ tr/\t//) {
+	fail("Mixed tabs and spaces in entry for $file");
+    } else {
+	fail("Odd whitespace in entry for $file");
+    }
+}
+
+close $m or die $!;
+
+is($failed, 0, 'All lines are good');

--
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About