#!/usr/bin/perl -w use strict; use CondTestMore tests => 6; # TEST BEGIN { use_ok("WWW::Form"); } my $www_form = WWW::Form->new({}); # TEST ok($www_form, "Initialization"); { my %attributes = ( 'first' => "Hello", "second" => "Good", "third" => "yoohoo", ); my $expected = q{ first="Hello" second="Good" third="yoohoo"}; my $real = $www_form->_render_attributes(\%attributes); # TEST is ( $real, $expected, "Simple Attribute Rendering"); } { my %attributes = ( 'first' => "D&D", ); my $expected = q{ first="D&D"}; my $real = $www_form->_render_attributes(\%attributes); # TEST is ( $real, $expected, "Attribute Rendering with Ampersand (& -> &)"); } { my %attributes = ( 'style' => "font : \"Helvetica\"", ); my $expected = q{ style="font : "Helvetica""}; my $real = $www_form->_render_attributes(\%attributes); # TEST is ( $real, $expected, "Attribute Rendering with Double Quotes (\" -> ")"); } { my %attributes = ( 'name' => "", ); my $expected = q{ name="<jonathan>"}; my $real = $www_form->_render_attributes(\%attributes); # TEST is ( $real, $expected, "Attribute Rendering with < and > Signs"); }