]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
comments.t: Assert that comments get permalink metadata
authorSimon McVittie <smcv@debian.org>
Sun, 3 Feb 2019 16:06:36 +0000 (16:06 +0000)
committerSimon McVittie <smcv@debian.org>
Sun, 3 Feb 2019 16:18:18 +0000 (16:18 +0000)
Signed-off-by: Simon McVittie <smcv@debian.org>
t/comments.t
t/tinyblog/post.mdwn

index 9bc40b66a2596c8e72a2118b0c3c59b222544f78..fc87d72ff273f3d83d800f62ee637287efa20357 100755 (executable)
@@ -68,6 +68,18 @@ sub slurp {
 
 my $content = slurp("t/tmp/out/post/index.html");
 ok(defined $content);
-ok($content =~ m/I conquered.*I explored.*I landed/s);
+like($content, qr/I conquered.*I explored.*I landed/s);
+
+$content = slurp("t/tmp/out/post/index.atom");
+ok(defined $content);
+like($content, qr{
+       <link\s*href="http://example\.com/post/[#]comment-[[:xdigit:]]+"
+       .*
+       <link\s*href="http://example\.com/post/[#]comment-[[:xdigit:]]+"
+       .*
+       <link\s*href="http://example\.com/post/[#]comment-[[:xdigit:]]+"
+}sx, 'Each comment gets an appropriate permalink in <link>');
+unlike($content, qr{<link\s*href=.*/post/comment_[123]/});
+unlike($content, qr{<link\s*href=.*/post/comment_[123]_[[:xdigit:]]+/});
 
 done_testing();
index 9eaeec7efda243efd8d3b3cce78b00d11fe80844..993155b45c2a01d3fd96b1e6fce9cc949478022d 100644 (file)
@@ -1 +1,3 @@
 only post
+
+[[!inline pages="internal(post/comment_*)" atom="yes" rss="no" feedonly="yes"]]