Trials

object Trials
Companion:
class
class Object
trait Matchable
class Any
Trials.type

Type members

Classlikes

implicit class CharacterTrialsSyntax(val characterTrials: Trials[Char])

Value members

Concrete methods

Start here: this yields a TrialsApi instance that is the gateway to creating various kinds of Trials instances via its factory methods.

Start here: this yields a TrialsApi instance that is the gateway to creating various kinds of Trials instances via its factory methods.

Returns:

A stateless TrialsApi instance.

Note:

All the methods defined in Trials itself are either ways of transforming and building up more complex trials, or for putting them to work by running test code.

def reject(): Unit

Reject the test case that has been supplied to the currently executing trial; this aborts the trial, but more test cases can still be supplied. Like the use of filtration, this approach will interact correctly with the shrinkage mechanism, which is why it is provided.

Reject the test case that has been supplied to the currently executing trial; this aborts the trial, but more test cases can still be supplied. Like the use of filtration, this approach will interact correctly with the shrinkage mechanism, which is why it is provided.

Note:

This method will abort a trial's execution by throwing a private exception handled by the framework implementation. If it is called outside a trial, then it returns control as a no-operation.

def whenever(guardPrecondition: Boolean)(block: => Unit): Unit

This is an alternative to calling Trials.filter - the idea here is to embed calls to this method in the test itself as an enclosing guard condition prior to executing the core testing code. Usually the guard precondition would involve some check on the supplied case and possibly some other inputs that come from elsewhere. Like the use of filtration, this approach will interact correctly with the shrinkage mechanism, which is why it is provided.

This is an alternative to calling Trials.filter - the idea here is to embed calls to this method in the test itself as an enclosing guard condition prior to executing the core testing code. Usually the guard precondition would involve some check on the supplied case and possibly some other inputs that come from elsewhere. Like the use of filtration, this approach will interact correctly with the shrinkage mechanism, which is why it is provided.

Value parameters:
block

The core testing code, lazily evaluated.

guardPrecondition

A precondition that must be satisfied to run the test code.

Implicits

Implicits

final implicit def CharacterTrialsSyntax(characterTrials: Trials[Char]): CharacterTrialsSyntax
implicit val functorFilterInstance: FunctorFilter[Trials]
implicit val monadInstance: Monad[Trials]