use warnings;
use strict;
-use XML::Twig;
use Test::More;
+BEGIN {
+ unless (eval { require XML::Twig }) {
+ eval q{
+ use Test::More skip_all => "XML::Twig is not available"
+ }
+ }
+}
+
BEGIN { use_ok("IkiWiki"); }
BEGIN { use_ok("IkiWiki::Render"); }
BEGIN { use_ok("IkiWiki::Plugin::map"); }
writefile("$page.mdwn", "t/tmp", "your ad here");
}
+sub comment {
+ my $str = shift;
+ $str =~ s/^/# /gm;
+ print $str;
+}
+
sub node {
my $name = shift;
my $kids = shift;
sub check {
my $pagespec = shift;
my $expected = shift;
- print "*** $pagespec ***\n";
+ comment("*** $pagespec ***\n");
my $html = IkiWiki::Plugin::map::preprocess(pages => $pagespec,
page => 'map',
destpage => 'map');
+ comment($html);
my $tree = XML::Twig->new(pretty_print => 'indented');
- eval {
+ eval {
$tree->parse($html);
};
if ($@) {
}
$tree->dispose;
- print "<!-- -->\n";
}
check('doesnotexist', []);