diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-04-04 17:27:48 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-04-04 17:27:48 -0400 |
commit | 8e92468eae9ac0ab8161a0c71ff6c6a0a8aef07a (patch) | |
tree | 9e26465e0ca98a5f3cbc6c72a0cace4bf83b93db /t/htmlbalance.t | |
parent | 78a69e5bd632eb86ef8135e9c1d05d2c48b43362 (diff) | |
parent | 08fda4c9d374de1d3de3172a192d4d915d3dc0c1 (diff) |
Merge branch 'master'
Conflicts:
doc/ikiwiki-makerepo.mdwn
Diffstat (limited to 't/htmlbalance.t')
-rwxr-xr-x | t/htmlbalance.t | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/htmlbalance.t b/t/htmlbalance.t new file mode 100755 index 000000000..e5a5db0ee --- /dev/null +++ b/t/htmlbalance.t @@ -0,0 +1,23 @@ +#!/usr/bin/perl +use warnings; +use strict; + +BEGIN { + eval q{ + use HTML::TreeBuilder; + }; + if ($@) { + eval q{use Test::More skip_all => "HTML::TreeBuilder not available"}; + } + else { + eval q{use Test::More tests => 7}; + } + 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>"); |