From 4f989781df46ab69ab6c43f110fde97709071487 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 20 Aug 2010 12:40:40 -0500 Subject: [PATCH] remove WebGUI::Utility::makeCommaSafe --- lib/WebGUI/Utility.pm | 21 +-------------------- t/Utility.t | 12 ------------ 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/lib/WebGUI/Utility.pm b/lib/WebGUI/Utility.pm index 62a662e13..7c52fffce 100644 --- a/lib/WebGUI/Utility.pm +++ b/lib/WebGUI/Utility.pm @@ -23,7 +23,7 @@ use Net::CIDR::Lite; our @ISA = qw(Exporter); our @EXPORT = qw(&makeTabSafe &randomizeHash &randomizeArray &isInSubnet - &sortHashDescending &sortHash &isIn &makeCommaSafe &randint &round &scalarEquals + &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 = makeCommaSafe($string); $string = makeTabSafe($string); $integer = randint($low,$high); $hashRef = randomizeHash(\%hash); @@ -121,24 +120,6 @@ sub isInSubnet { #------------------------------------------------------------------- -=head2 makeCommaSafe ( text ) - -Replaces commas with semi-colons and carriage returns with spaces. - -=head3 text - -The text to search through. - -=cut - -sub makeCommaSafe { - my $text = $_[0]; - $text =~ tr/,\r\n/; /; - return $text; -} - -#------------------------------------------------------------------- - =head2 makeTabSafe ( text ) Replaces tabs with four spaces and carriage returns with a space each. diff --git a/t/Utility.t b/t/Utility.t index 4ef57bfa7..24835d3e8 100644 --- a/t/Utility.t +++ b/t/Utility.t @@ -25,18 +25,6 @@ my $session = WebGUI::Test->session; # isIn ok(WebGUI::Utility::isIn("webgui", qw(cars trucks webgui trains)), 'isIn()'); -# makeCommaSafe -unlike(WebGUI::Utility::makeCommaSafe("this,that,foo,,bar"), qr/,/, 'makeCommaSafe()'); -is( - WebGUI::Utility::makeCommaSafe("this,that,foo,,bar"), - 'this;that;foo;;bar', - 'makeCommaSafe()' -); -is( - WebGUI::Utility::makeCommaSafe("this,that\nfoo\rbar\r\n"), - 'this;that foo bar ', - 'makeCommaSafe()' -); # makeTabSafe unlike(WebGUI::Utility::makeTabSafe("this\tthat\tfoo\tbar\t"), qr/\t/, 'makeTabSafe()');