remove WebGUI::Utility::randomizeHash

This commit is contained in:
Graham Knop 2010-08-20 12:43:10 -05:00
parent 721ab1fbd6
commit f68ac24495
2 changed files with 1 additions and 31 deletions

View file

@ -22,7 +22,7 @@ use Tie::IxHash;
use Net::CIDR::Lite;
our @ISA = qw(Exporter);
our @EXPORT = qw(&randomizeHash &randomizeArray &isInSubnet
our @EXPORT = qw(&randomizeArray &isInSubnet
&sortHashDescending &sortHash &isIn &randint &round &scalarEquals
);
@ -41,7 +41,6 @@ This package provides miscellaneous but useful utilities to the WebGUI programme
$boolean = isIn($value, @array);
$boolean = isInSubnet($ip, \@subnets);
$integer = randint($low,$high);
$hashRef = randomizeHash(\%hash);
$rounded = round($number, $digits);
%hash = sortHash(%hash);
%hash = sortHashDescending(%hash);
@ -162,29 +161,6 @@ sub randomizeArray {
#-------------------------------------------------------------------
=head2 randomizeHash ( hashRef )
Resorts a hash tied to IxHash in random order. Returns a hash reference.
=head3 hashRef
A reference hash to randomize.
=cut
sub randomizeHash {
my $hash = $_[0];
my @keys = keys %$hash;
randomizeArray(\@keys);
tie my %temp, 'Tie::IxHash';
foreach my $key (@keys) {
$temp{$key} = $hash->{$key};
}
return \%temp;
}
#-------------------------------------------------------------------
=head2 round ( float [, significantDigits ] )
Returns an integer after rounding a floating point number.

View file

@ -40,12 +40,6 @@ SKIP: {
ok(undef, 'randomizeArray()');
}
# randomizeHash
SKIP: {
skip("Don't know how to test randomizeHash.",1);
ok(undef, 'randomizeHash()');
}
# round
is(WebGUI::Utility::round(47.133984233, 0), 47, 'round() - 0 significant digits');
is(WebGUI::Utility::round(47.133984233, 3), 47.134, 'round() - multiple significant digits');