Skip to content

Commit bd55cd8

Browse files
DilumAluthgeantoine-levitt
authored andcommitted
Add tests to make sure that Base.project_names, Base.manifest_names, Base.preferences_names, and Artifacts.artifact_names always have the same length (JuliaLang#40618)
* Add tests to make sure that `Base.project_names`, `Base.manifest_names`, `Base.preferences_names`, and `Artifacts.artifact_names` always have the same length * Add a comment explaining why we have these tests
1 parent 566bdae commit bd55cd8

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

stdlib/Artifacts/test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,10 @@ end
157157
end
158158
end
159159
end
160+
161+
@testset "`Artifacts.artifact_names` and friends" begin
162+
n = length(Artifacts.artifact_names)
163+
@test length(Base.project_names) == n
164+
@test length(Base.manifest_names) == n
165+
@test length(Base.preferences_names) == n
166+
end

test/loading.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,3 +718,10 @@ import .Foo.Libdl; import Libdl
718718
end
719719
end
720720
end
721+
722+
@testset "`Base.project_names` and friends" begin
723+
# Some functions in Pkg assumes that these tuples have the same length
724+
n = length(Base.project_names)
725+
@test length(Base.manifest_names) == n
726+
@test length(Base.preferences_names) == n
727+
end

0 commit comments

Comments
 (0)