add a test for makeArrayTabSafe and add comments to WebGUI::Utility
This commit is contained in:
parent
b07956fa06
commit
d566d0db8c
2 changed files with 13 additions and 2 deletions
|
|
@ -225,7 +225,8 @@ Searches through an array looking for tabs and replaces them with four spaces. A
|
||||||
|
|
||||||
=head3 array
|
=head3 array
|
||||||
|
|
||||||
A reference to the array to look through.
|
A reference to the array to look through. The array itself is modified, rather than
|
||||||
|
returning useful data.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
||||||
12
t/Utility.t
12
t/Utility.t
|
|
@ -17,7 +17,8 @@ use Tie::IxHash;
|
||||||
use WebGUI::Test;
|
use WebGUI::Test;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
|
|
||||||
use Test::More tests => 43; # increment this value for each test you create
|
use Test::More tests => 44; # increment this value for each test you create
|
||||||
|
use Test::Deep;
|
||||||
|
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
|
@ -77,6 +78,15 @@ is(
|
||||||
'makeCommaSafe(): clearing tabs, newlines and carriage returns'
|
'makeCommaSafe(): clearing tabs, newlines and carriage returns'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# makeArrayTabSafe -- modifies an array in place
|
||||||
|
my $tabbedArray = ["this\tthat", "these\nthose"];
|
||||||
|
WebGUI::Utility::makeArrayTabSafe($tabbedArray);
|
||||||
|
cmp_deeply(
|
||||||
|
$tabbedArray,
|
||||||
|
["this that", "these those"],
|
||||||
|
'makeArrayTabSafe'
|
||||||
|
);
|
||||||
|
|
||||||
# randint
|
# randint
|
||||||
my $number = WebGUI::Utility::randint(50,75);
|
my $number = WebGUI::Utility::randint(50,75);
|
||||||
ok($number >= 50 && $number <= 75, 'randint()');
|
ok($number >= 50 && $number <= 75, 'randint()');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue