Skip to content

Commit 3326ff3

Browse files
expand tests
1 parent 880aadd commit 3326ff3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/file.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,27 @@ end
3636
mktempdir() do dir
3737
touch(joinpath(dir, "afile.txt"))
3838
mkdir(joinpath(dir, "adir"))
39+
touch(joinpath(dir, "adir", "bfile.txt"))
3940
@test length(readdir(dir)) == 2
4041
@test readdir(dir) == map(e->e.name, readdir(DirEntry, dir))
4142
@test readdir(DirEntry, dir) == readdir(DirEntry(dir))
43+
for p in readdir(dir, join=true)
44+
if isdir(p)
45+
@test only(readdir(p)) == "bfile.txt"
46+
else
47+
@test isfile(p)
48+
@test p == joinpath(dir, "afile.txt")
49+
end
50+
end
51+
for e in readdir(DirEntry, dir)
52+
if isdir(e) || continue
53+
@test only(readdir(e)).name == "bfile.txt"
54+
@test only(readdir(DirEntry, e)).name == "bfile.txt"
55+
else
56+
@test isfile(e)
57+
@test e.name == "afile.txt"
58+
end
59+
end
4260
end
4361
end
4462

0 commit comments

Comments
 (0)