aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2012-08-03 12:49:20 +0100
committerSimon McVittie <smcv@debian.org>2013-02-24 13:10:24 +0000
commit12ca01fd5c67c158e916c9068453271235a2a0e7 (patch)
treeddb2f65c6e07200f8cd858d76595210ce7b7cadc /t
parent3f27a9733660c811c6b8d640ddadbd811979e24c (diff)
downloadikiwiki-12ca01fd5c67c158e916c9068453271235a2a0e7.tar
ikiwiki-12ca01fd5c67c158e916c9068453271235a2a0e7.tar.gz
map test: print maps' source as comments
Diffstat (limited to 't')
-rwxr-xr-xt/map.t12
1 files changed, 9 insertions, 3 deletions
diff --git a/t/map.t b/t/map.t
index 4c8e5ede6..e764457d1 100755
--- a/t/map.t
+++ b/t/map.t
@@ -56,6 +56,12 @@ foreach my $page (@pages) {
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;
@@ -105,13 +111,14 @@ sub check_nodes {
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 ($@) {
@@ -131,7 +138,6 @@ sub check {
}
$tree->dispose;
- print "<!-- -->\n";
}
check('doesnotexist', []);