RecursiveSelectiveMatch v0.1.0 RecursiveSelectiveMatch View Source

RecursiveSelectiveMatch lets you specify a deeply nested test data structure and check whether another actual data structure contains all keys and values specified in the test data strucure. The actual data structure can include extra keys not mentioned in the tes data structure. And actual data structure values will be ignored whenever the corresponding test data structure value is :anything.

Link to this section Summary

Link to this section Functions

Link to this function matches?(expected, actual, opts \\ %{}) View Source

matches?()

Examples

iex> RecursiveSelectiveMatch.matches?(%{what: :ever}, %{what: :ever, not: :checked})
true

iex> RecursiveSelectiveMatch.matches?(%{what: :ever, is: :checked}, %{what: :ever}, %{suppress_warnings: true})
false