diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-16 18:34:30 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-16 18:34:30 +0000 |
commit | 908801fe7019314da9ec6cbe0d45f36d440c0aea (patch) | |
tree | ba68fcb64855612da505c164db6124a7fd54e9c6 /lib/Test | |
parent | b637ffadabdd74cf3d1ad745a96611c427d33ba5 (diff) | |
download | perl-908801fe7019314da9ec6cbe0d45f36d440c0aea.tar.gz |
Make the code even more dynamical so that testname
suffix length can change.
p4raw-id: //depot/perl@10638
Diffstat (limited to 'lib/Test')
-rw-r--r-- | lib/Test/Harness.pm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm index 8966ca6620..18ee902439 100644 --- a/lib/Test/Harness.pm +++ b/lib/Test/Harness.pm @@ -396,13 +396,16 @@ sub _run_all_tests { my $t_start = new Benchmark; my $maxlen = 0; - foreach (@tests) { - my $len = length; - $maxlen = $len if $len > $maxlen; + my $maxsuflen = 0; + foreach (@tests) { # The same code in t/TEST + my $suf = /\.(\w+)$/ ? $1 : ''; + my $len = length; + my $suflen = length $suf; + $maxlen = $len if $len > $maxlen; + $maxsuflen = $suflen if $suflen > $maxsuflen; } - # +3 : we want three dots between the test name and the "ok" - # -2 : the .t suffix - my $width = $maxlen + 3 - 2; + # + 3 : we want three dots between the test name and the "ok" + my $width = $maxlen + 3 - $maxsuflen; foreach my $tfile (@tests) { my($leader, $ml) = _mk_leader($tfile, $width); print $leader; |