webgui/t/Macro/URLEncode.t
Colin Kuskie 6aab9a6eec Rework all tests to call the Macro's process subroutine directly.
Add RootTitle.t test.
Broke up the SettingMacros.t test into individual tests.
2006-07-26 19:02:22 +00:00

54 lines
1.3 KiB
Perl

#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2006 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
use FindBin;
use strict;
use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Macro::URLEncode;
use WebGUI::Session;
use Data::Dumper;
use Test::More; # increment this value for each test you create
my $session = WebGUI::Test->session;
my @testSets = (
{
input => q! !,
output => q!%20!,
comment => q|space|,
},
{
input => q!/!,
output => q!%2F!,
comment => q|slash|,
},
{
input => q!abcde!,
output => q!abcde!,
comment => q|alpha|,
},
{
input => q!&!,
output => q!%26!,
comment => q|ampersand|,
},
);
my $numTests = scalar @testSets;
plan tests => $numTests;
foreach my $testSet (@testSets) {
my $output = WebGUI::Macro::URLEncode::process($session, $testSet->{input});
is($output, $testSet->{output}, 'testing '.$testSet->{input});
}