File: getdir.t

package info (click to toggle)
libfuse-perl 0.16.1%2B20180422git6becd92d7fce3fc411d7c-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 608 kB
  • sloc: perl: 1,938; makefile: 8
file content (36 lines) | stat: -rw-r--r-- 919 bytes parent folder | download | duplicates (4)
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
#!/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
foreach $fname (@names) {
    open($file, '>', $fname);
    close($file);
}

# 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;