File: line-lengths.t

package info (click to toggle)
memcached 1.6.39-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,320 kB
  • sloc: ansic: 62,281; perl: 12,500; sh: 4,569; makefile: 468; python: 402; xml: 59
file content (25 lines) | stat: -rwxr-xr-x 520 bytes parent folder | download | duplicates (3)
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");
}