]> sipb.mit.edu Git - ikiwiki.git/blobdiff - t/conflicts.t
(no commit message)
[ikiwiki.git] / t / conflicts.t
index ac270e8062c48db261b28650faddcabb16ec678c..d7e04d3ae39a66b1bdcd711aa0aa0ee12f0584ec 100755 (executable)
@@ -2,7 +2,7 @@
 # Tests for bugs relating to conflicting files in the srcdir
 use warnings;
 use strict;
-use Test::More tests => 48;
+use Test::More tests => 106;
 
 # setup
 my $srcdir="t/tmp/src";
@@ -64,6 +64,19 @@ setupiki("initial setup");
 ok(! system("touch $srcdir/foo.mdwn"));
 refreshiki("conflicting non-page added (page already existing) in refresh");
 
+# Page that renders to a file that is also a subdirectory holding another
+# file.
+newsrcdir();
+ok(! system("touch $srcdir/foo.mdwn"));
+ok(! system("mkdir -p $srcdir/foo/index.html"));
+ok(! system("touch $srcdir/foo/index.html/bar.mdwn"));
+setupiki("conflicting page file and subdirectory");
+newsrcdir();
+ok(! system("touch $srcdir/foo.mdwn"));
+ok(! system("mkdir -p $srcdir/foo/index.html"));
+ok(! system("touch $srcdir/foo/index.html/bar"));
+setupiki("conflicting page file and subdirectory 2");
+
 # Changing a page file into a non-page could also cause ikiwiki to fail.
 newsrcdir();
 ok(! system("touch $srcdir/foo.mdwn"));
@@ -86,6 +99,13 @@ setupiki("initial setup");
 ok(! system("mkdir -p $srcdir/foo"));
 ok(! system("touch $srcdir/foo/index.html"));
 refreshiki("rawhtml file rendered same as existing page in refresh");
+# Moved when refreshing
+newsrcdir();
+ok(! system("touch $srcdir/foo.mdwn"));
+setupiki("initial setup");
+ok(! system("mkdir -p $srcdir/foo"));
+ok(! system("mv $srcdir/foo.mdwn $srcdir/foo/index.html"));
+refreshiki("existing page moved to rawhtml file in refresh");
 # Inverse added when refreshing
 newsrcdir();
 ok(! system("mkdir -p $srcdir/foo"));
@@ -93,6 +113,13 @@ ok(! system("touch $srcdir/foo/index.html"));
 setupiki("initial setup");
 ok(! system("touch $srcdir/foo.mdwn"));
 refreshiki("page rendered same as existing rawhtml file in refresh");
+# Inverse moved when refreshing
+newsrcdir();
+ok(! system("mkdir -p $srcdir/foo"));
+ok(! system("touch $srcdir/foo/index.html"));
+setupiki("initial setup");
+ok(! system("mv $srcdir/foo/index.html $srcdir/foo.mdwn"));
+refreshiki("rawhtml file moved to page in refresh");
 # Present during setup
 newsrcdir();
 ok(! system("touch $srcdir/foo.mdwn"));