]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
map test: print maps' source as comments
authorSimon McVittie <smcv@debian.org>
Fri, 3 Aug 2012 11:49:20 +0000 (12:49 +0100)
committerSimon McVittie <smcv@debian.org>
Sun, 24 Feb 2013 13:10:24 +0000 (13:10 +0000)
t/map.t

diff --git a/t/map.t b/t/map.t
index 4c8e5ede655aa69756c1873219d1d6fe34484069..e764457d1c13b687b1632b3f5c5ea4c474f865d0 100755 (executable)
--- 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', []);