diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2007-09-14 13:18:58 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2007-09-14 13:18:58 +0200 |
commit | 8f416baead93a48e5799e44b8bd2e2c4859f4e04 (patch) | |
tree | cd47ac55eb80a39e3225e8b4f3161b88ea16c2cf /t/maint/unix-newlines.t | |
parent | d7d08bd1a17618c7d77a6b9b2989e9f7293d6ed6 (diff) |
auf Version 1.11 aktualisiert; Login-Bug behoben
Diffstat (limited to 't/maint/unix-newlines.t')
-rw-r--r-- | t/maint/unix-newlines.t | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/t/maint/unix-newlines.t b/t/maint/unix-newlines.t index 91a24ad7..c47dd17c 100644 --- a/t/maint/unix-newlines.t +++ b/t/maint/unix-newlines.t @@ -5,23 +5,28 @@ use warnings; use Test::More;; use File::Find; -use File::Slurp qw< slurp >; -use Socket qw< $CRLF $LF >; +use Socket '$CRLF'; 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; +plan 'no_plan'; 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"; - } + open my $fh, "<", $file or die "Can't open $file: $!"; + binmode $fh; + + my $ok = 1; + while (<$fh>) { + if (/$CRLF/) { + fail "$file has \\r\\n on line $."; + $ok = 0; + } + } + + pass "$file has only unix newlines" if $ok; } |