From f635a1b35a9ae25956e5d2e66d4718ebcda2ccc8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 19 Jan 2007 12:01:43 +0000 Subject: [PATCH] r56629@Arsia: avar | 2007-01-19 11:52:12 +0000 * Regression test to make sure we use unix newlines --- t/maint/unix-newlines.t | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 t/maint/unix-newlines.t 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"; + } +} + + + -- 2.20.1