Skip to content

Commit 631ed08

Browse files
authored
Also check that every entry in WeakCompat.toml has a corresponding entry in WeakDeps.toml
1 parent fcd704e commit 631ed08

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

src/registry_testing.jl

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -245,21 +245,35 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
245245
# Note: it is legal for a package to have Compat.toml but not have
246246
# Deps.toml. Specifically, this is legal if (and only if) the package
247247
# does not have any dependencies, and does have a compat entry for `julia`.
248-
if isfile(compatfile)
249-
compat_uncompressed = RegistryTools.Compress.load(compatfile)
250-
deps_uncompressed = isfile(depsfile) ? RegistryTools.Compress.load(depsfile) : Dict()
251-
for v in keys(vers)
252-
compat_for_this_v = get(compat_uncompressed, v, Dict())
253-
deps_for_this_v = get(deps_uncompressed, v, Dict())
254-
Test.@test compat_for_this_v isa AbstractDict
255-
Test.@test deps_for_this_v isa AbstractDict
256-
for compat_pkgname in keys(compat_for_this_v)
257-
# If the package has a compat entry for `julia`, there
258-
# is no need to have `julia` listed in Deps.toml.
259-
# However, every other compat entry needs to be listed
260-
# in Deps.toml.
261-
if compat_pkgname != "julia"
262-
Test.@test haskey(deps_for_this_v, compat_pkgname)
248+
for weak in ["", "Weak"]
249+
compatfile = abspath(data["path"], "$(weak)Compat.toml")
250+
depsfile = abspath(data["path"], "$(weak)Deps.toml")
251+
if isfile(compatfile)
252+
if weak == "Weak"
253+
# It is NOT legal for a package to have WeakCompat.toml but not have
254+
# WeakDeps.toml
255+
@test isfile(depsfile)
256+
end
257+
compat_uncompressed = RegistryTools.Compress.load(compatfile)
258+
deps_uncompressed = isfile(depsfile) ? RegistryTools.Compress.load(depsfile) : Dict()
259+
for v in keys(vers)
260+
compat_for_this_v = get(compat_uncompressed, v, Dict())
261+
deps_for_this_v = get(deps_uncompressed, v, Dict())
262+
Test.@test compat_for_this_v isa AbstractDict
263+
Test.@test deps_for_this_v isa AbstractDict
264+
for compat_pkgname in keys(compat_for_this_v)
265+
if weak == "Weak"
266+
# It is legal to have `julia` in Compat.toml.
267+
# It is NOT legal to have `julia` in WeakCompat.toml
268+
@test compat_pkgname != "julia"
269+
end
270+
# If the package has a compat entry for `julia`, there
271+
# is no need to have `julia` listed in Deps.toml.
272+
# However, every other (weak)compat entry needs to be listed
273+
# in (Weak)Deps.toml.
274+
if compat_pkgname != "julia"
275+
Test.@test haskey(deps_for_this_v, compat_pkgname)
276+
end
263277
end
264278
end
265279
end

0 commit comments

Comments
 (0)