@@ -238,6 +238,46 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
238238 else
239239 @debug " Compat.toml file does not exist" compatfile
240240 end
241+
242+ # https://github.com/JuliaRegistries/RegistryCI.jl/issues/522
243+ # For every version, each compat entry has a corresponding deps entry.
244+ #
245+ # Note: it is legal for a package to have Compat.toml but not have
246+ # Deps.toml. Specifically, this is legal if (and only if) the package
247+ # does not have any dependencies, and does have a compat entry for `julia`.
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. @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. @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
277+ end
278+ end
279+ end
280+ end
241281 end
242282 # Make sure all paths are unique
243283 path_parts = [splitpath (data[" path" ]) for (_, data) in reg[" packages" ]]
0 commit comments