Skip to content

Commit

Permalink
Map over only the values of the dictionaries
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge authored Aug 12, 2022
1 parent 736053d commit 88f772c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/registry_testing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
compressed = RegistryTools.Compress.compress(
compatfile, RegistryTools.Compress.load(compatfile)
)
mapdict = (f, dict) -> Dict(f(k, v) for (k, v) in dict)
f_inner = (k, v) -> (k, Pkg.Types.VersionRange.(v))
f_outer = (k, dict) -> (k, mapdict(f_inner, dict))
Test.@test mapdict(f_outer, compressed) == mapdict(f_outer, compat)
mapvalues = (f, dict) -> Dict(k => f(v) for (k, v) in dict)
f_inner = v -> Pkg.Types.VersionRange.(v)
f_outer = dict -> mapvalues(f_inner, dict)
Test.@test mapvalues(f_outer, compressed) == mapvalues(f_outer, compat)
end
end
# Make sure all paths are unique
Expand Down

0 comments on commit 88f772c

Please sign in to comment.