]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - t/prune.t
img: restrict to JPEG, PNG and GIF images by default
[git.ikiwiki.info.git] / t / prune.t
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4 use Test::More tests => 6;
5 use File::Path qw(make_path remove_tree);
7 BEGIN { use_ok("IkiWiki"); }
8 BEGIN { use_ok("IkiWiki::Render"); }
10 %config=IkiWiki::defaultconfig();
12 remove_tree("t/tmp");
14 make_path("t/tmp/srcdir/a/b/c");
15 make_path("t/tmp/srcdir/d/e/f");
16 writefile("a/b/c/d.mdwn", "t/tmp/srcdir", "foo");
17 writefile("d/e/f/g.mdwn", "t/tmp/srcdir", "foo");
18 IkiWiki::prune("t/tmp/srcdir/d/e/f/g.mdwn");
19 ok(-d "t/tmp/srcdir");
20 ok(! -e "t/tmp/srcdir/d");
21 IkiWiki::prune("t/tmp/srcdir/a/b/c/d.mdwn", "t/tmp/srcdir");
22 ok(-d "t/tmp/srcdir");
23 ok(! -e "t/tmp/srcdir/a");