Match

com.phasmidsoftware.matchers.Matchers.Match
See theMatch companion class
object Match

Companion object for the Match class providing factory methods.

This object allows the creation of MatchResult instances by comparing two values of type R. If the two values are equal, a Match is constructed, and a message indicating the match result is printed to the standard error stream.

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Matchers.this.Matchers.this.Match.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def of[T](t: => T): Matchers.this.MatchResult[T]

Evaluates a lazily-provided block of code and returns a MatchResult encapsulating the value if evaluation is successful. If the evaluation fails with an exception, the exception is wrapped and rethrown as a MatcherException.

Evaluates a lazily-provided block of code and returns a MatchResult encapsulating the value if evaluation is successful. If the evaluation fails with an exception, the exception is wrapped and rethrown as a MatcherException.

CONSIDER whether we should return an Error instead of throwing an exception.

Value parameters

t

The lazily-evaluated block of code whose result is to be encapsulated in a MatchResult.

Attributes

Returns

A MatchResult encapsulating the successfully evaluated value of t.

Throws
MatcherException

If the evaluation of the block t throws an exception.