From c12159ce21141d5374fbc32b73c0ae760826826e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 22 Apr 2005 22:29:48 +0000 Subject: show up to 5 (random) test cases using the keyword --- tests/keywords.pl | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/keywords.pl b/tests/keywords.pl index 2c83b546f..620317d73 100755 --- a/tests/keywords.pl +++ b/tests/keywords.pl @@ -71,20 +71,47 @@ for $t (split(/ /, $TESTCASES)) { chomp; #print "Test $t: $_\n"; $k{$_}++; - $t{$_} .= "$_ "; + $t{$_} .= "$t "; } $count++; } +sub show { + my ($list)=@_; + my @a = split(" ", $list); + my $ret; + + my $c; + my @l = sort {rand(100) - 50} @a; + my @ll; + + for(1 .. 6) { + my $v = shift @l; + if($v) { + push @ll, $v; + } + } + + for (sort {$a <=> $b} @ll) { + if($c++ == 5) { + $ret .= "..."; + last; + } + $ret .= "$_ "; + } + return $ret; +} + # numerically on amount, or alphebetically if same amount my @mtest = reverse sort { $k{$a} <=> $k{$b} || $b cmp $a } keys %k; print <No TestsKeyword + TOP ; for $t (@mtest) { - printf "\n", $k{$t}; + printf "\n", $k{$t}, + show($t{$t}); } printf "
NumKeywordTest Cases
%d$t
%d$t%s

$count tests (%d lack keywords)\n", scalar(@miss); -- cgit v1.2.3