Machete.MaybeMatcher (Machete v0.3.11)
View SourceDefines a matcher that matches against another matcher & also matches nil
Summary
Functions
Matches against another matcher & also matches nil
Types
Functions
@spec maybe(Machete.Matchable.t()) :: t()
Matches against another matcher & also matches nil
Takes another matcher as its sole (mandatory) argument
Examples:
iex> assert nil ~> maybe(string())
true
iex> assert "abc" ~> maybe(string())
true