Skip to content

Commit

Permalink
fix check for std lib in direct_dependencies (JuliaEcosystem#33)
Browse files Browse the repository at this point in the history
* fix check for std lib

* ad comment

Co-authored-by: Eric Hanson <[email protected]>

Co-authored-by: Eric Hanson <[email protected]>
  • Loading branch information
hexaeder and ericphanson authored May 30, 2021
1 parent 27d072d commit 61b85d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PkgDeps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ function direct_dependencies(pkg_entry::PkgEntry)
end

function direct_dependencies(pkg_name::String; registries::Array{RegistryInstance}=reachable_registries())
if pkg_name in keys(STDLIBS)
if pkg_name in values(STDLIBS)
return Dict{String, UUID}()
end
return direct_dependencies(_find_latest_pkg_entry(pkg_name, missing; registries))
end

function direct_dependencies(pkg_uuid::UUID; registries::Array{RegistryInstance}=reachable_registries())
if pkg_uuid in values(STDLIBS)
if pkg_uuid in keys(STDLIBS)
return Dict{String, UUID}()
end
return direct_dependencies(_find_latest_pkg_entry(missing, pkg_uuid; registries))
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ end
deps = direct_dependencies("Case2"; registries=all_registries)
@test deps == Dict("DownDep" => UUID("000eeb74-f857-587a-a816-be5685e97e75"),
"Statistics" => UUID("10745b16-79ce-11e8-11f9-7d13ad32a3b2"))

deps = direct_dependencies("LinearAlgebra")
@test isempty(deps)
# test with LinearAlgebra's UUID
deps = direct_dependencies(UUID("37e2e46d-f89d-539d-b4ee-838fcccc9c8e"))
@test isempty(deps)
end

@testset "`dependencies`" begin
Expand Down

0 comments on commit 61b85d5

Please sign in to comment.