1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 8;
use HTML::Widgets::NavMenu::EscapeHtml qw/ escape_html /;
{
# TEST
is( escape_html("hello"), "hello", "Simple 1" );
# TEST
is( escape_html("hi\nYou rule."), "hi\nYou rule.", "Simple 2 with WS" );
# TEST
is( escape_html("D&D"), "D&D", "Ampersand" );
# TEST
is( escape_html("<b>Hello</b>"), "<b>Hello</b>", "Tags" );
# TEST
is( escape_html("&"), "&amp;", "Double amp" );
# TEST
is( escape_html("&<hello>"), "&<hello>", "Seq of 2" );
# TEST
is( escape_html(q{Hi "phony"}), q{Hi "phony"}, "Double quotes" );
# TEST
is( escape_html(q{"<&>"}), q{"<&>"}, "All in one" );
}
|