Treat scalar references as escaped in quote(), so that raw input can be
given if one really wants to.
sub quote {
my $self = shift;
+ return ${$_[0]} if ref $_[0] eq 'SCALAR';
return XML::Quote::xml_quote_min($_[0]);
}
use Test::More;
-plan tests => 72;
+plan tests => 76;
use_ok('HTML::Form::Simple');
my $form = HTML::Form::Simple->new;
ok($form, 'new form');
+# basics
+
+is(
+ $form->quote('<"test">'),
+ '<"test">',
+ 'quote'
+);
+
+is(
+ $form->quote(\'<"test">'),
+ '<"test">',
+ 'quote unquoted'
+);
+
+is(
+ $form->tag('foo'),
+ '<foo>',
+ 'tag'
+);
+
+is(
+ $form->tag('a "' => {'b"' => 'c"'}),
+ '<a " b"="c"">',
+ 'tag attributes'
+);
+
# form
is(