aboutsummaryrefslogtreecommitdiff
path: root/t/prune.t
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2012-04-08 15:54:25 -0400
committerJoey Hess <joey@kitenet.net>2012-04-08 15:54:25 -0400
commitb92e8caa4d8f71e6a354fda23a7a99afda62bf75 (patch)
tree771407707423a661ef8310b703c20424ed808c7a /t/prune.t
parent8cdbe23435d6a027d25c106c00ba34665fd54ed1 (diff)
parenta7f8a4eb983c8cd92aa45d8e2000939915c377ec (diff)
downloadikiwiki-b92e8caa4d8f71e6a354fda23a7a99afda62bf75.tar
ikiwiki-b92e8caa4d8f71e6a354fda23a7a99afda62bf75.tar.gz
Merge remote-tracking branch 'smcv/ready/transient-rm'
Diffstat (limited to 't/prune.t')
-rwxr-xr-xt/prune.t23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/prune.t b/t/prune.t
new file mode 100755
index 000000000..8c3925e9e
--- /dev/null
+++ b/t/prune.t
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Test::More tests => 6;
+use File::Path qw(make_path remove_tree);
+
+BEGIN { use_ok("IkiWiki"); }
+BEGIN { use_ok("IkiWiki::Render"); }
+
+%config=IkiWiki::defaultconfig();
+
+remove_tree("t/tmp");
+
+make_path("t/tmp/srcdir/a/b/c");
+make_path("t/tmp/srcdir/d/e/f");
+writefile("a/b/c/d.mdwn", "t/tmp/srcdir", "foo");
+writefile("d/e/f/g.mdwn", "t/tmp/srcdir", "foo");
+IkiWiki::prune("t/tmp/srcdir/d/e/f/g.mdwn");
+ok(-d "t/tmp/srcdir");
+ok(! -e "t/tmp/srcdir/d");
+IkiWiki::prune("t/tmp/srcdir/a/b/c/d.mdwn", "t/tmp/srcdir");
+ok(-d "t/tmp/srcdir");
+ok(! -e "t/tmp/srcdir/a");