@@ -238,6 +238,32 @@ 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+ 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)
263+ end
264+ end
265+ end
266+ end
241267 end
242268 # Make sure all paths are unique
243269 path_parts = [splitpath (data[" path" ]) for (_, data) in reg[" packages" ]]
0 commit comments