remove WebGUI::Utility::makeTabSafe

This commit is contained in:
Graham Knop 2010-08-20 12:41:47 -05:00
parent 4f989781df
commit 721ab1fbd6
2 changed files with 1 additions and 34 deletions

View file

@ -22,7 +22,7 @@ use Tie::IxHash;
use Net::CIDR::Lite;
our @ISA = qw(Exporter);
our @EXPORT = qw(&makeTabSafe &randomizeHash &randomizeArray &isInSubnet
our @EXPORT = qw(&randomizeHash &randomizeArray &isInSubnet
&sortHashDescending &sortHash &isIn &randint &round &scalarEquals
);
@ -40,7 +40,6 @@ This package provides miscellaneous but useful utilities to the WebGUI programme
use WebGUI::Utility;
$boolean = isIn($value, @array);
$boolean = isInSubnet($ip, \@subnets);
$string = makeTabSafe($string);
$integer = randint($low,$high);
$hashRef = randomizeHash(\%hash);
$rounded = round($number, $digits);
@ -120,25 +119,6 @@ sub isInSubnet {
#-------------------------------------------------------------------
=head2 makeTabSafe ( text )
Replaces tabs with four spaces and carriage returns with a space each.
=head3 text
The text to search through.
=cut
sub makeTabSafe {
my $text = $_[0];
$text =~ tr/\r\n/ /;
$text =~ s/\t/ /g;
return $text;
}
#-------------------------------------------------------------------
=head2 randint ( low, high )
Returns an integer between the low and high number.

View file

@ -26,19 +26,6 @@ my $session = WebGUI::Test->session;
ok(WebGUI::Utility::isIn("webgui", qw(cars trucks webgui trains)), 'isIn()');
# makeTabSafe
unlike(WebGUI::Utility::makeTabSafe("this\tthat\tfoo\tbar\t"), qr/\t/, 'makeTabSafe()');
is(
WebGUI::Utility::makeTabSafe("this\tthat\tfoo\tbar\t"),
"this that foo bar ",
'makeCommaSafe(): clearing tabs'
);
is(
WebGUI::Utility::makeTabSafe("this\nthat\tfoo\rbar\r\n"),
"this that foo bar ",
'makeCommaSafe(): clearing tabs, newlines and carriage returns'
);
# randint
my $number = WebGUI::Utility::randint(50,75);
ok($number >= 50 && $number <= 75, 'randint()');