aboutsummaryrefslogtreecommitdiffstats
path: root/perl/test/getdir.t
blob: 1d605613e35d0cc81a983340e6123cdaca121850 (plain) (blame)
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
#!/usr/bin/perl
use test::helper qw($_real $_point);
use Test::More;
my (@names) = qw(abc def ghi jkl mno pqr stu jlk sfdaljk  sdfakjlsdfa kjldsf kjl;sdf akjl;asdf klj;asdf lkjsdflkjsdfkjlsdfakjsdfakjlsadfkjl;asdfklj;asdfkjl;asdfklj;asdfkjl;asdfkjlasdflkj;sadf);
@names = sort(@names);
plan tests => 2 * scalar @names;
chdir($_real);

# create entries
map { system("touch \"$_\"") } @names;

# make sure they exist in real dir
opendir(REAL,$_real);
my (@ents) = readdir(REAL);
closedir(REAL);
@ents = sort(@ents);
map {
	shift(@ents) while($ents[0] eq '.' || $ents[0] eq '..');
	is(shift(@ents),$_,"ent $_")
} @names;

# make sure they exist in fuse dir
opendir(POINT,$_point);
@ents = readdir(POINT);
closedir(POINT);
@ents = sort(@ents);
map {
	shift(@ents) while($ents[0] eq '.' || $ents[0] eq '..');
	is(shift(@ents),$_,"ent $_")
} @names;

# remove them
map { unlink } @names;