blob: 34f3666101b122f20b225dd23ed6582d024ca78a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#!/usr/bin/perl
use warnings;
use strict;
use Test::More tests => 27;
BEGIN { use_ok("IkiWiki"); }
%config=IkiWiki::defaultconfig();
ok(IkiWiki::file_pruned(".htaccess"));
ok(IkiWiki::file_pruned(".ikiwiki/"));
ok(IkiWiki::file_pruned(".ikiwiki/index"));
ok(IkiWiki::file_pruned("CVS/foo"));
ok(IkiWiki::file_pruned("subdir/CVS/foo"));
ok(IkiWiki::file_pruned(".svn"));
ok(IkiWiki::file_pruned("subdir/.svn"));
ok(IkiWiki::file_pruned("subdir/.svn/foo"));
ok(IkiWiki::file_pruned(".git"));
ok(IkiWiki::file_pruned("subdir/.git"));
ok(IkiWiki::file_pruned("subdir/.git/foo"));
ok(! IkiWiki::file_pruned("svn/fo"));
ok(! IkiWiki::file_pruned("git"));
ok(! IkiWiki::file_pruned("index.mdwn"));
ok(! IkiWiki::file_pruned("index."));
ok(IkiWiki::file_pruned("."));
ok(IkiWiki::file_pruned("./"));
# absolute filenames are not allowed.
ok(IkiWiki::file_pruned("/etc/passwd"));
ok(IkiWiki::file_pruned("//etc/passwd"));
ok(IkiWiki::file_pruned("/"));
ok(IkiWiki::file_pruned("//"));
ok(IkiWiki::file_pruned("///"));
ok(IkiWiki::file_pruned(".."));
ok(IkiWiki::file_pruned("../"));
ok(IkiWiki::file_pruned("y/foo.dpkg-tmp"));
ok(IkiWiki::file_pruned("y/foo.ikiwiki-new"));
|