From 721ab1fbd6698bbfd7b6f50c55f84f4c9d763681 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 20 Aug 2010 12:41:47 -0500 Subject: [PATCH] remove WebGUI::Utility::makeTabSafe --- lib/WebGUI/Utility.pm | 22 +--------------------- t/Utility.t | 13 ------------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/lib/WebGUI/Utility.pm b/lib/WebGUI/Utility.pm index 7c52fffce..fb384a0af 100644 --- a/lib/WebGUI/Utility.pm +++ b/lib/WebGUI/Utility.pm @@ -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. diff --git a/t/Utility.t b/t/Utility.t index 24835d3e8..18f3b5b3e 100644 --- a/t/Utility.t +++ b/t/Utility.t @@ -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()');