4 use Test::More 'no_plan';
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");
15 [[!comment username="neil"
16 date="1969-07-20T20:17:40Z"
19 #ok(eval { writefile("post/comment_3._comment", "t/tmp/in", $comment); 1 });
20 writefile("post/comment_3._comment", "t/tmp/in", $comment);
23 [[!comment username="christopher"
24 date="1969-02-12T07:00:00Z"
25 content="I explored"]]
27 writefile("post/comment_2._comment", "t/tmp/in", $comment);
30 [[!comment username="william"
31 date="1969-01-14T12:00:00Z"
32 content="I conquered"]]
34 writefile("post/comment_1._comment", "t/tmp/in", $comment);
36 # Give the files mtimes in the wrong order
37 ok(utime(111111111, 111111111, "t/tmp/in/post/comment_3._comment"));
38 ok(utime(222222222, 222222222, "t/tmp/in/post/comment_2._comment"));
39 ok(utime(333333333, 333333333, "t/tmp/in/post/comment_1._comment"));
42 ok(! system("make -s ikiwiki.out"));
43 ok(! system("perl -I. ./ikiwiki.out --verbose --plugin comments --url=http://example.com --cgiurl=http://example.com/ikiwiki.cgi --rss --atom --underlaydir=underlays/basewiki --set underlaydirbase=underlays --set comments_pagespec='*' --templatedir=templates t/tmp/in t/tmp/out"));
45 # Check that the comments are in the right order
48 open my $fh, "<", shift or return undef;
51 close $fh or return undef;
55 my $content = slurp("t/tmp/out/post/index.html");
57 ok($content =~ m/I conquered.*I explored.*I landed/s);