just adding to that, if you’re talking about tests… if you pattern match you can just look for the stuff you care for in a particular test run… so that works
If I understand your problem properly I would like to suggest this approach.
Let’s say we have map_a = %{a: "a", b: "b", c: "c"} and map_b: %{a: "a", b: "b", c: "no_match"}
We could use Enum.reduce_while/3 to iterate through map_a and compare key and value from map_a with the key and value of map_b.
Enum.reduce_while(map_a, true, fn {k, v}, acc ->
# This statement checks if the key from map_a exists in map_b. if the key exists, also checks the
# value of the keys. If it is true, iteration is continued, otherwise it is halted and it will return false
if v == Map.get(map_b, k) do
{:cont, acc}
else
{:halt, false}
end
end)