7 ok(! system("rm -rf t/tmp"));
9 ok(! system("cp -R t/tinyblog t/tmp/in"));
10 ok(mkdir "t/tmp/in/post" or -d "t/tmp/in/post");
12 my $installed = $ENV{INSTALLED_TESTS};
16 @command = qw(ikiwiki);
19 ok(! system("make -s ikiwiki.out"));
20 @command = qw(perl -I. ./ikiwiki.out
21 --underlaydir=underlays/basewiki
22 --set underlaydirbase=underlays
23 --templatedir=templates);
29 [[!comment username="neil"
30 date="1969-07-20T20:17:40Z"
33 #ok(eval { writefile("post/comment_3._comment", "t/tmp/in", $comment); 1 });
34 writefile("post/comment_3._comment", "t/tmp/in", $comment);
37 [[!comment username="christopher"
38 date="1969-02-12T07:00:00Z"
39 content="I explored"]]
41 writefile("post/comment_2._comment", "t/tmp/in", $comment);
44 [[!comment username="william"
45 date="1969-01-14T12:00:00Z"
46 content="I conquered"]]
48 writefile("post/comment_1._comment", "t/tmp/in", $comment);
50 # Give the files mtimes in the wrong order
51 ok(utime(111111111, 111111111, "t/tmp/in/post/comment_3._comment"));
52 ok(utime(222222222, 222222222, "t/tmp/in/post/comment_2._comment"));
53 ok(utime(333333333, 333333333, "t/tmp/in/post/comment_1._comment"));
56 ok(! system(@command, qw(--verbose --plugin comments --url=http://example.com --cgiurl=http://example.com/ikiwiki.cgi --rss --atom --set comments_pagespec=* t/tmp/in t/tmp/out)));
58 # Check that the comments are in the right order
61 open my $fh, "<", shift or return undef;
64 close $fh or return undef;
68 my $content = slurp("t/tmp/out/post/index.html");
70 ok($content =~ m/I conquered.*I explored.*I landed/s);