summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-07-16 16:10:44 -0400
committerJoey Hess <joey@kitenet.net>2010-07-16 16:11:24 -0400
commitfd842e03e6a9d7b14bd161cc7ff6d9d48e8bf00c (patch)
treebf5b66b1dd2c4551ec5754193e4ea5401fc81e36 /t
parent936dc6fc8ed7bbb05ad858c04894e317924fef8f (diff)
add 2 failing test cases
Diffstat (limited to 't')
-rwxr-xr-xt/replace.t21
1 files changed, 20 insertions, 1 deletions
diff --git a/t/replace.t b/t/replace.t
index 7d91f772f..04791d9f7 100755
--- a/t/replace.t
+++ b/t/replace.t
@@ -1,4 +1,5 @@
#!/usr/bin/perl
+# Tests for bugs relating to replacing/renaming files in the srcdir.
use warnings;
use strict;
use Test::More 'no_plan';
@@ -7,7 +8,6 @@ use Test::More 'no_plan';
my $srcdir="t/tmp/src";
my $destdir="t/tmp/dest";
ok(! system("make -s ikiwiki.out"));
-ok(! system("mkdir -p $srcdir"));
# runs ikiwiki to build test site
sub runiki {
@@ -20,15 +20,34 @@ sub setupiki {
ok(! system("rm -rf $srcdir/.ikiwiki $destdir"));
runiki("--rebuild");
}
+sub newsrcdir {
+ ok(! system("rm -rf $srcdir $destdir"));
+ ok(! system("mkdir -p $srcdir"));
+}
# At one point, changing the extension of the source file of a page caused
# ikiwiki to fail.
+newsrcdir();
ok(! system("touch $srcdir/foo.mdwn"));
setupiki();
ok(! system("mv $srcdir/foo.mdwn $srcdir/foo.html"));
refreshiki();
+ok(! system("mv $srcdir/foo.html $srcdir/foo.mdwn"));
+refreshiki();
# Changing a non-page file into a page could also cause ikiwiki to fail.
+newsrcdir();
+ok(! system("touch $srcdir/foo"));
+setupiki();
+ok(! system("mv $srcdir/foo $srcdir/foo.mdwn"));
+refreshiki();
+
+# Changing a page file into a non-page could also cause ikiwiki to fail.
+newsrcdir();
+ok(! system("touch $srcdir/foo.mdwn"));
+setupiki();
+ok(! system("mv $srcdir/foo.mdwn $srcdir/foo"));
+refreshiki();
# cleanup
ok(! system("rm -rf t/tmp"));