File: encoding.t

package info (click to toggle)
ack-grep 1.96-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,060 kB
  • sloc: perl: 5,822; sh: 162; makefile: 21; ansic: 21; fortran: 11
file content (22 lines) | stat: -rw-r--r-- 404 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!perl -Tw

use warnings;
use strict;

use Test::More tests => 1;

my $file = './ack';

my $ok = 1;
open( my $fh, '<', $file ) or die "Can't read $file: \n";
while ( my $line = <$fh> ) {
    chomp $line;
    if ( $line =~ /[^ -~]/ ) {
        my $col = $-[0] + 1;
        diag( "$file has hi-bit characters at $.:$col" );
        $ok = 0;
    }
}
close $fh;

ok( $ok, "$file has no hi-bit characters" );