diff options
Diffstat (limited to 't/maint/unix-newlines.t')
-rw-r--r-- | t/maint/unix-newlines.t | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/maint/unix-newlines.t b/t/maint/unix-newlines.t new file mode 100644 index 00000000..91a24ad7 --- /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"; + } +} + + + |