+writefile("sorting/linked.mdwn", "t/tmp/in", "linked");
+writefile("sorting/a/b.mdwn", "t/tmp/in", "a/b");
+writefile("sorting/a/c.mdwn", "t/tmp/in", "a/c");
+writefile("sorting/z/a.mdwn", "t/tmp/in", "z/a");
+writefile("sorting/beginning.mdwn", "t/tmp/in", "beginning");
+writefile("sorting/middle.mdwn", "t/tmp/in", "middle");
+writefile("sorting/end.mdwn", "t/tmp/in", "end");
+writefile("sorting/new.mdwn", "t/tmp/in", "new");
+writefile("sorting/old.mdwn", "t/tmp/in", "old");
+writefile("sorting/ancient.mdwn", "t/tmp/in", "ancient");
+# These three need to be in the appropriate age order
+ok(utime(333333333, 333333333, "t/tmp/in/sorting/new.mdwn"));
+ok(utime(222222222, 222222222, "t/tmp/in/sorting/old.mdwn"));
+ok(utime(111111111, 111111111, "t/tmp/in/sorting/ancient.mdwn"));
+writefile("sorting/linked2.mdwn", "t/tmp/in", "linked2");
+# This initially uses the default sort order: age for trailinline, and path
+# for trail. We change it later.
+writefile("sorting.mdwn", "t/tmp/in",
+ '[[!traillink linked]] ' .
+ '[[!trail pages="sorting/z/a or sorting/a/b or sorting/a/c"]] ' .
+ '[[!trail pagenames="beginning middle end"]] ' .
+ '[[!trailinline pages="sorting/old or sorting/ancient or sorting/new"]] ' .
+ '[[!traillink linked2]]');