0
|
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 = grep {! /^config.h$/ } (glob("*.h"), glob("*.c"), glob("*.ac"), "memcached.spec");
|
|
9 }
|
|
10 use Test::More tests => scalar(@files);
|
|
11
|
|
12 foreach my $f (@files) {
|
|
13 open(my $fh, $f) or die;
|
|
14 my $before = do { local $/; <$fh>; };
|
|
15 close ($fh);
|
|
16 my $after = $before;
|
|
17 $after =~ s/\t/ /g;
|
|
18 $after =~ s/ +$//mg;
|
|
19 $after .= "\n" unless $after =~ /\n$/;
|
|
20 ok ($after eq $before, "$f (see devtools/clean-whitespace.pl)");
|
|
21 }
|