Update hardening rules.
[awesomized/libmemcached] / memcached / t / line-lengths.t
1 #!/usr/bin/perl
2 use strict;
3 use FindBin qw($Bin);
4 our @files;
5
6 BEGIN {
7 chdir "$Bin/.." or die;
8 @files = ( "doc/protocol.txt" );
9 }
10
11 use Test::More tests => scalar(@files);
12
13 foreach my $f (@files) {
14 open(my $fh, $f) or die("Can't open $f");
15 my @long_lines = ();
16 my $line_number = 0;
17 while(<$fh>) {
18 $line_number++;
19 if(length($_) > 80) {
20 push(@long_lines, $line_number);
21 }
22 }
23 close($fh);
24 ok(@long_lines == 0, "$f has a long lines: @long_lines");
25 }