View Source Machete.IndifferentAccessMatcher (Machete v0.3.1)

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

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)

Types

@opaque t()

Describes an instance of this matcher

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