use strict; use warnings; use Test::More tests => 7; use HTML::FormFu::Util qw( literal append_xml_attribute xml_escape ); { my %attr = ( foo => literal "{foo}, "baz" ); is( xml_escape( \%attr )->{foo}, "baz" ); # literal + string append_xml_attribute( \%attr, "foo", "{foo}, "baz <boo" ); } { my %attr = ( foo => "{foo}, "<bar" ); # string + string append_xml_attribute( \%attr, "foo", ">baz" ); is( xml_escape( \%attr )->{foo}, "<bar >baz" ); # string + literal append_xml_attribute( \%attr, "foo", literal "{foo}, "<bar >baz {foo}, "<bar >baz