File: line-lengths.t

package info (click to toggle)
memcached 1.4.5-1%2Bdeb6u1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,644 kB
  • ctags: 1,357
  • sloc: ansic: 8,329; sh: 3,977; perl: 3,343; xml: 1,594; makefile: 167
file content (25 lines) | stat: -rwxr-xr-x 516 bytes parent folder | download | duplicates (10)
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/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");
}