Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Feb 29, 2024
1 parent b75f588 commit 2efb19c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions base/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,7 @@ isfifo(obj::DirEntry) = (isunknown(obj) || islink(obj)) ? isfifo(obj.path)
issocket(obj::DirEntry) = (isunknown(obj) || islink(obj)) ? issocket(obj.path) : obj.rawtype == UV_DIRENT_SOCKET
ischardev(obj::DirEntry) = (isunknown(obj) || islink(obj)) ? ischardev(obj.path) : obj.rawtype == UV_DIRENT_CHAR
isblockdev(obj::DirEntry) = (isunknown(obj) || islink(obj)) ? isblockdev(obj.path) : obj.rawtype == UV_DIRENT_BLOCK
realpath(obj::DirEntry) = realpath(obj.path)

"""
_readdirx(dir::AbstractString=pwd(); sort::Bool = true) -> Vector{DirEntry}
Expand Down
7 changes: 4 additions & 3 deletions test/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ if !Sys.iswindows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
symlink(subdir, dirlink)
@test stat(dirlink) == stat(subdir)
@test readdir(dirlink) == readdir(subdir)
@test Base.Filesystem._readdirx(dirlink) == Base.Filesystem._readdirx(subdir)
@test map(o->o.names, Base.Filesystem._readdirx(dirlink)) == map(o->o.names, Base.Filesystem._readdirx(subdir))
@test realpath.(Base.Filesystem._readdirx(dirlink)) == realpath.(Base.Filesystem._readdirx(subdir))

# relative link
relsubdirlink = joinpath(subdir, "rel_subdirlink")
Expand All @@ -58,7 +59,7 @@ if !Sys.iswindows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
mkdir(new_dir)
touch(foo_file)
@test readdir(new_dir) == readdir(nedlink)
@test Base.Filesystem._readdirx(new_dir) == Base.Filesystem._readdirx(nedlink)
@test realpath.(Base.Filesystem._readdirx(new_dir)) == realpath.(Base.Filesystem._readdirx(nedlink))

rm(foo_file)
rm(new_dir)
Expand Down Expand Up @@ -1444,7 +1445,7 @@ rm(dirwalk, recursive=true)
touch(randstring())
end
@test issorted(readdir())
@test issorted(_readdirx())
@test issorted(Base.Filesystem._readdirx())
@test map(o->o.name, Base.Filesystem._readdirx()) == readdir()
@test map(o->o.path, Base.Filesystem._readdirx()) == readdir(join=true)
@test count(isfile, readdir(join=true)) == count(isfile, Base.Filesystem._readdirx())
Expand Down
6 changes: 3 additions & 3 deletions test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1363,9 +1363,9 @@ end
@test isdefined(KwdefWithEsc_TestModule, :Struct)

@testset "exports of modules" begin
for (_, mod) in Base.loaded_modules
@testset "$mod" for (_, mod) in Base.loaded_modules
mod === Main && continue # Main exports everything
for v in names(mod)
@testset "$v" for v in names(mod)
@test isdefined(mod, v)
end
end
Expand Down Expand Up @@ -1521,7 +1521,7 @@ end
@testset "Base docstrings" begin
undoc = Docs.undocumented_names(Base)
@test_broken isempty(undoc)
@test undoc == [:BufferStream, :CanonicalIndexError, :CapturedException, :Filesystem, :IOServer, :InvalidStateException, :Order, :PipeEndpoint, :Sort, :TTY]
@test undoc == [:BufferStream, :CanonicalIndexError, :CapturedException, :DirEntry, :Filesystem, :IOServer, :InvalidStateException, :Order, :PipeEndpoint, :Sort, :TTY]
end

@testset "Base.Libc docstrings" begin
Expand Down

0 comments on commit 2efb19c

Please sign in to comment.