Command

trait Command[S, I, O] extends CommandIO[S]

The specification for the expected behaviour of an Action.

trait CommandIO[S]
class Object
trait Matchable
class Any

Type members

Types

type Input = I
type Output = O

Value members

Abstract methods

def ensure(env: Environment, before: S, after: S, i: Input, o: Output): Result

A post-condition for a command that must be verified for the command to be considered a success.

A post-condition for a command that must be verified for the command to be considered a success.

def execute(env: Environment, s: Input): Either[String, Output]

Executes a command using the arguments generated by gen.

Executes a command using the arguments generated by gen.

def gen(s: S): Option[GenT[Input]]

A generator which provides random arguments for a command. If the command cannot be executed in the current state, it should return None.

A generator which provides random arguments for a command. If the command cannot be executed in the current state, it should return None.

def update(s0: S, i: Input, o: Var[Output]): S

Updates the model state, given the input and output of the command.

Updates the model state, given the input and output of the command.

Concrete methods

final override def command: Command[S, Input, Output]
Definition Classes
def renderInput(i: Input): String

Render the input for displaying in test output.

Render the input for displaying in test output.

The default is to use toString, but optionally can support being overridden.

def require(s: S, i: Input): Boolean

A pre-condition for a command that must be verified before the command can be executed. This is mainly used during shrinking to ensure that it is still OK to run a command despite the fact that some previously executed commands may have been removed from the sequence.

A pre-condition for a command that must be verified before the command can be executed. This is mainly used during shrinking to ensure that it is still OK to run a command despite the fact that some previously executed commands may have been removed from the sequence.

def vars(i: Input): List[Var[_]]

Return a list of all Var instances referenced by Input

Return a list of all Var instances referenced by Input

Failure to do this correctly will result in missing variable errors during shrinking.