remove WebGUI::Utility::randomizeArray

This commit is contained in:
Graham Knop 2010-08-20 12:43:40 -05:00
parent f68ac24495
commit c1132e4298
2 changed files with 1 additions and 26 deletions

View file

@ -22,7 +22,7 @@ use Tie::IxHash;
use Net::CIDR::Lite;
our @ISA = qw(Exporter);
our @EXPORT = qw(&randomizeArray &isInSubnet
our @EXPORT = qw(&isInSubnet
&sortHashDescending &sortHash &isIn &randint &round &scalarEquals
);
@ -142,25 +142,6 @@ sub randint {
#-------------------------------------------------------------------
=head2 randomizeArray ( )
Don't use this function, it is depricated and will be removed at some point in the future. Instead use List::Util::shuffle()
=cut
sub randomizeArray {
my $array = shift;
if ($#$array > 0) {
for (my $i = @$array; --$i; ) {
my $j = int rand ($i+1);
next if $i == $j;
@$array[$i,$j] = @$array[$j,$i];
}
}
}
#-------------------------------------------------------------------
=head2 round ( float [, significantDigits ] )
Returns an integer after rounding a floating point number.

View file

@ -34,12 +34,6 @@ ok($number >= 0 && $number <= 1, 'randint() with default params');
my $number = WebGUI::Utility::randint(10,5);
ok($number >= 5 && $number <= 10, 'randint() auto reverses params if they are backwards');
# randomizeArray
SKIP: {
skip("Don't know how to test randomizeArray.",1);
ok(undef, 'randomizeArray()');
}
# 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');