Mercurial > hg > memcached
diff t/whitespace.t @ 0:30782bb1fc04 MEMCACHED_1_2_3
memcached-1.2.3
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sun, 23 Sep 2007 03:58:34 +0400 |
parents | |
children |
line wrap: on
line diff
new file mode 100755 --- /dev/null +++ b/t/whitespace.t @@ -0,0 +1,21 @@ +#!/usr/bin/perl +use strict; +use FindBin qw($Bin); +our @files; + +BEGIN { + chdir "$Bin/.." or die; + @files = grep {! /^config.h$/ } (glob("*.h"), glob("*.c"), glob("*.ac"), "memcached.spec"); +} +use Test::More tests => scalar(@files); + +foreach my $f (@files) { + open(my $fh, $f) or die; + my $before = do { local $/; <$fh>; }; + close ($fh); + my $after = $before; + $after =~ s/\t/ /g; + $after =~ s/ +$//mg; + $after .= "\n" unless $after =~ /\n$/; + ok ($after eq $before, "$f (see devtools/clean-whitespace.pl)"); +}