Packages

o

org.scalatest.matchers

MatchSucceeded

object MatchSucceeded

Singleton object that provides unapply method to extract negated failure message from MatchResult having matches property value of true.

Source
MatchSucceeded.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MatchSucceeded
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def unapply(matchResult: MatchResult)(implicit prettifier: Prettifier): Option[String]

    Extractor enabling patterns that match MatchResult having matches property value of true, extracting the contained negated failure message.

    Extractor enabling patterns that match MatchResult having matches property value of true, extracting the contained negated failure message.

    For example, you can use this extractor to get the negated failure message of a MatchResult like this:

    matchResult match {
      case MatchSucceeded(negatedFailureMessage) => // do something with negatedFailureMessage
      case _ => // when matchResult.matches equal to false
    }
    

    matchResult

    the MatchResult to extract the negated failure message from.

    returns

    a Some wrapping the contained negated failure message if matchResult.matches is equal to true, else None.