View Source Machete.IndifferentAccessMatcher (Machete v0.2.3)

Defines a matcher that matches indifferently (that is, it considers similar atom and string keys to be equivalent)

Link to this section Summary

Types

t()

Describes an instance of this matcher

Functions

Defines a matcher that matches indifferently (that is, it considers similar atom and string keys to be equivalent)

Link to this section Types

@opaque t()

Describes an instance of this matcher

Link to this section Functions

@spec indifferent_access(map()) :: t()

Defines a matcher that matches indifferently (that is, it considers similar atom and string keys to be equivalent)

Takes a map as its sole (mandatory) argument

Examples:

iex> assert %{a: 1} ~> indifferent_access(%{a: 1})
true

iex> assert %{"a" => 1} ~> indifferent_access(%{"a" => 1})
true

iex> assert %{a: 1} ~> indifferent_access(%{"a" => 1})
true

iex> assert %{"a" => 1} ~> indifferent_access(%{a: 1})
true

iex> assert %{1 => 1} ~> indifferent_access(%{1 => 1})
true