From: Ævar Arnfjörð Bjarmason Date: Fri, 19 Jan 2007 12:01:43 +0000 (+0000) Subject: r56629@Arsia: avar | 2007-01-19 11:52:12 +0000 X-Git-Tag: 1.31.0-rc.0~54298 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=f635a1b35a9ae25956e5d2e66d4718ebcda2ccc8;p=lhc%2Fweb%2Fwiklou.git r56629@Arsia: avar | 2007-01-19 11:52:12 +0000 * Regression test to make sure we use unix newlines --- diff --git a/t/maint/unix-newlines.t b/t/maint/unix-newlines.t new file mode 100644 index 0000000000..91a24ad77a --- /dev/null +++ b/t/maint/unix-newlines.t @@ -0,0 +1,28 @@ +#!/usr/bin/env perl +use strict; +use warnings; + +use Test::More;; + +use File::Find; +use File::Slurp qw< slurp >; +use Socket qw< $CRLF $LF >; + +my $ext = qr/(?: t | pm | sql | js | php | inc | xml )/x; + +my @files; +find( sub { push @files, $File::Find::name if -f && /\. $ext $/x }, '.' ); + +plan tests => scalar @files; + +for my $file (@files) { + my $cont = slurp $file; + if ( $cont and $cont =~ $CRLF ) { + ok 0 => "$file contains windows newlines"; + } else { + ok 1 => "$file is made of unix newlines and win"; + } +} + + +