Index: trunk/phase3/t/maint/bom.t |
— | — | @@ -14,14 +14,12 @@ |
15 | 15 | use Test::More; |
16 | 16 | |
17 | 17 | use File::Find; |
18 | | -use File::Slurp qw< slurp >; |
19 | 18 | |
20 | 19 | # Files for wich we want to check the BOM char ( 0xFE 0XFF ) |
21 | 20 | my $ext = qr/(?:php|inc)/x ; |
22 | 21 | |
23 | 22 | my $bomchar = qr/\xef\xbb\xbf/ ; |
24 | 23 | |
25 | | - |
26 | 24 | my @files; |
27 | 25 | |
28 | 26 | find( sub{ push @files, $File::Find::name if -f && /\.$ext$/ }, '.' ); |
— | — | @@ -30,10 +28,11 @@ |
31 | 29 | plan tests => scalar @files ; |
32 | 30 | |
33 | 31 | for my $file (@files) { |
34 | | - my $content = slurp $file ; |
35 | | - if( $content =~ /$bomchar/ ) { |
36 | | - fail "$file got a Byte Order Mark"; |
| 32 | + open my $fh, "<", $file or die "Couln't open $file: $!"; |
| 33 | + my $line = <$fh>; |
| 34 | + if( $line =~ /$bomchar/ ) { |
| 35 | + fail "$file has a Byte Order Mark at line $."; |
37 | 36 | } else { |
38 | | - pass "$file BOM less"; |
| 37 | + pass "$file has no Byte Order Mark!"; |
39 | 38 | } |
40 | 39 | } |
Property changes on: . |
___________________________________________________________________ |
Modified: svk:merge |
41 | 40 | - 27bc04cf-33ed-4153-9a14-f265503a8842:/local/mediawiki:61330 |
7cf7ea9e-0fb0-4aec-bfeb-b705e7e456c6:/local/mediawiki:61660 |
42 | 41 | + 27bc04cf-33ed-4153-9a14-f265503a8842:/local/mediawiki:61331 |
7cf7ea9e-0fb0-4aec-bfeb-b705e7e456c6:/local/mediawiki:61660 |