r24277 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24276‎ | r24277 | r24278 >
Date:00:05, 20 July 2007
Author:avar
Status:old
Tags:
Comment:
Report the lines win32 newlines are found at
Modified paths:
  • / (modified) (history)
  • /trunk/phase3/t/maint/unix-newlines.t (modified) (history)

Diff [purge]

Index: trunk/phase3/t/maint/unix-newlines.t
@@ -5,23 +5,28 @@
66 use Test::More;;
77
88 use File::Find;
9 -use File::Slurp qw< slurp >;
10 -use Socket qw< $CRLF $LF >;
 9+use Socket '$CRLF';
1110
1211 my $ext = qr/(?: t | pm | sql | js | php | inc | xml )/x;
1312
1413 my @files;
1514 find( sub { push @files, $File::Find::name if -f && /\. $ext $/x }, '.' );
1615
17 -plan tests => scalar @files;
 16+plan 'no_plan';
1817
1918 for my $file (@files) {
20 - my $cont = slurp $file;
21 - if ( $cont and $cont =~ $CRLF ) {
22 - pass "$file contains windows newlines";
23 - } else {
24 - fail "$file is made of unix newlines and win";
25 - }
 19+ open my $fh, "<", $file or die "Can't open $file: $!";
 20+ binmode $fh;
 21+
 22+ my $ok = 1;
 23+ while (<$fh>) {
 24+ if (/$CRLF/) {
 25+ fail "$file has \\r\\n on line $.";
 26+ $ok = 0;
 27+ }
 28+ }
 29+
 30+ pass "$file has only unix newlines" if $ok;
2631 }
2732
2833
Property changes on: .
___________________________________________________________________
Modified: svk:merge
2934 - 27bc04cf-33ed-4153-9a14-f265503a8842:/local/mediawiki:61202
7cf7ea9e-0fb0-4aec-bfeb-b705e7e456c6:/local/mediawiki:61660
3035 + 27bc04cf-33ed-4153-9a14-f265503a8842:/local/mediawiki:61330
7cf7ea9e-0fb0-4aec-bfeb-b705e7e456c6:/local/mediawiki:61660

Follow-up revisions

RevisionCommit summaryAuthorDate
r24302Merged revisions 24276-24301 via svnmerge from...david03:42, 21 July 2007

Status & tagging log