diff options
author | Niels Thykier <niels@thykier.net> | 2016-02-22 07:17:02 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2016-02-22 07:17:02 +0000 |
commit | 70065726a62e8375110e426141862bdc42a06535 (patch) | |
tree | 8a1db491a6508f0bed4b8c8564cced88dc0b78f1 /t/size.t | |
parent | 2817017e87dd62426f6270fc9b0036838724052d (diff) | |
download | debhelper-70065726a62e8375110e426141862bdc42a06535.tar.gz |
t: Rename tests so prove can find them
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 't/size.t')
-rwxr-xr-x | t/size.t | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/t/size.t b/t/size.t new file mode 100755 index 00000000..813b2796 --- /dev/null +++ b/t/size.t @@ -0,0 +1,35 @@ +#!/usr/bin/perl +# This may appear arbitrary, but DO NOT CHANGE IT. +# Debhelper is supposed to consist of small, simple, easy to understand +# programs. Programs growing in size and complexity without bounds is a +# bug. +use Test::More; + +my @progs=grep { -x $_ } glob("dh_*"); + +plan(tests => (@progs + @progs)); + +foreach my $file (@progs) { + + my $lines=0; + my $maxlength=0; + open(IN, $file) || die "open: $!"; + my $cutting=0; + while (<IN>) { + $cutting=1 if /^=/; + $cutting=0 if /^=cut/; + next if $cutting || /^(?:=|\s*(?:\#.*)?$)/; + $lines++; + $maxlength=length($_) if length($_) > $maxlength; + } + close IN; + print "# $file has $lines lines, max length is $maxlength\n"; + ok($lines < 200, $file); + ok($maxlength < 160, $file); +} + +# Local Variables: +# indent-tabs-mode: t +# tab-width: 4 +# cperl-indent-level: 4 +# End: |