"Fossies" - the Fresh Open Source Software Archive

Member "memcached-1.6.15/t/line-lengths.t" (16 Jul 2020, 516 Bytes) of package /linux/www/memcached-1.6.15.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    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 }