summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn P. Linderman <jpl@research.att.com>2002-04-05 02:13:27 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-04-05 11:58:14 +0000
commit28e9118f23dc1b501af6ee6c0b70d68a5df2d3f2 (patch)
tree73e73c7b4a211a4717d893ef02e0d145fafdc9a8 /lib
parent7507ff2d5813d5a228151dfaf8d4c79a4d7cd652 (diff)
downloadperl-28e9118f23dc1b501af6ee6c0b70d68a5df2d3f2.tar.gz
Re: lib/sort.t failure (and [PATCH])
From: "John P. Linderman" <jpl@research.att.com> Message-ID: <200204051213.HAA13004@raptor.research.att.com> p4raw-id: //depot/perl@15741
Diffstat (limited to 'lib')
-rw-r--r--lib/sort.t22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/sort.t b/lib/sort.t
index c132a5c667..52d1d8be0e 100644
--- a/lib/sort.t
+++ b/lib/sort.t
@@ -58,15 +58,18 @@ sub genarray {
sub checkorder {
my $aref = shift;
my $status = ''; # so far, so good
- my $i;
+ my ($i, $disorder);
for ($i = 0; $i < $#$aref; ++$i) {
- next if ($aref->[$i] lt $aref->[$i+1]);
- $status = (substr($aref->[$i], 0, $RootWidth) eq
- substr($aref->[$i+1], 0, $RootWidth)) ?
- "Instability" : "Disorder";
- $status .= " at element $i between $aref->[$i] and $aref->[$i+1]";
- last;
+ # Equality shouldn't happen, but catch it in the contents check
+ next if ($aref->[$i] le $aref->[$i+1]);
+ $disorder = (substr($aref->[$i], 0, $RootWidth) eq
+ substr($aref->[$i+1], 0, $RootWidth)) ?
+ "Instability" : "Disorder";
+ # Keep checking if merely unstable... disorder is much worse.
+ $status =
+ "$disorder at element $i between $aref->[$i] and $aref->[$i+1]";
+ last unless ($disorder eq "Instability");
}
return $status;
}
@@ -121,6 +124,11 @@ sub main {
$status = checkequal(\@sorted, $unsorted);
is($status, '', "contents ok for size $ts");
}
+ # P5P: The following test (#58) has been observed failing on
+ # a solaris 2.8 platform. Failure doesn't mean that sort is
+ # misbehaving, it is just exhibiting an exceedingly unlikely
+ # pattern of breaking ties. If you see no other failures,
+ # it should be perfectly safe to install.
if ($expect_unstable) {
ok($unstable_num > 0, 'Instability ok');
}