summaryrefslogtreecommitdiff
path: root/t/line-lengths.t
blob: 5475bea226667c5e8ba1900824d5e794d3240bd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env perl
use strict;
use FindBin qw($Bin);
our @files;

BEGIN {
    chdir "$Bin/.." or die;
    @files = ( "doc/protocol.txt" );
}

use Test::More tests => scalar(@files);

foreach my $f (@files) {
    open(my $fh, $f) or die("Can't open $f");
    my @long_lines = ();
    my $line_number = 0;
    while(<$fh>) {
        $line_number++;
        if(length($_) > 80) {
            push(@long_lines, $line_number);
        }
    }
    close($fh);
    ok(@long_lines == 0, "$f has a long lines:  @long_lines");
}