diff options
author | joeyh <joeyh> | 2006-07-29 05:44:23 +0000 |
---|---|---|
committer | joeyh <joeyh> | 2006-07-29 05:44:23 +0000 |
commit | f8b8ab7d6b79c7aef2293ecf964e698658869193 (patch) | |
tree | 020a7696db396a67df644396bf27fe8b6805ea94 /t/size | |
parent | 13a9ceba269e905f4be6933ba5f84634076276e0 (diff) |
r1939: * Add size test, which fails on any debhelper program of more than 150
lines. This is not a joke, and 100 lines would be better.
Diffstat (limited to 't/size')
-rwxr-xr-x | t/size | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -0,0 +1,28 @@ +#!/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; + +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 < 150); + ok($maxlength < 160); +} |