summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-11-17 14:01:28 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-11-17 14:01:28 -0500
commit2d857e6aeb8eb959551f292578bfe4bf66cc16f1 (patch)
treeac42088c195f83f4fea4c3c9d146a66e6a6a5b06 /t
parente204a2c2027e3c593aae0c3e334634587e286e8d (diff)
parente7a840ed9a817cf4db59c90e680afd89e146b581 (diff)
Merge commit 'smcv/htmlbalance'
Diffstat (limited to 't')
-rwxr-xr-xt/htmlbalance.t13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/htmlbalance.t b/t/htmlbalance.t
new file mode 100755
index 000000000..cd124e473
--- /dev/null
+++ b/t/htmlbalance.t
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Test::More tests => 7;
+
+BEGIN { use_ok("IkiWiki::Plugin::htmlbalance"); }
+
+is(IkiWiki::Plugin::htmlbalance::sanitize(content => "<br></br>"), "<br />");
+is(IkiWiki::Plugin::htmlbalance::sanitize(content => "<div><p b=\"c\">hello world</div>"), "<div><p b=\"c\">hello world</p></div>");
+is(IkiWiki::Plugin::htmlbalance::sanitize(content => "<a></a></a>"), "<a></a>");
+is(IkiWiki::Plugin::htmlbalance::sanitize(content => "<b>foo <a</b>"), "<b>foo </b>");
+is(IkiWiki::Plugin::htmlbalance::sanitize(content => "<b> foo <a</a></b>"), "<b> foo </b>");
+is(IkiWiki::Plugin::htmlbalance::sanitize(content => "a>"), "a&gt;");