Documentation
¶
Overview ¶
Package states supports writing more complex state machine tests with the rapid property test framework.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PerformOne ¶
PerformOne chooses one property test action from a list and performs it. Actions are able to provide a precondition that must be satisfied; if it is not, the action is not included in the list of potential actions.
Types ¶
type Action ¶
type Action interface { // IsEnabled returns whether this action's precondition holds. If not, it // will not be included in the list of potential actions. IsEnabled() bool // Perform performs the action. Perform() }
Action is a potential action that can be performed by PerformOne.
type ActionFunc ¶
type ActionFunc func()
ActionFunc lets you use a simple function as an Action in PerformOne. Its precondition always holds.
func (ActionFunc) IsEnabled ¶
func (f ActionFunc) IsEnabled() bool
func (ActionFunc) Perform ¶
func (f ActionFunc) Perform()
type Test ¶
type Test struct {
// contains filtered or unexported fields
}
Test provides an Action that can be used to stop a test. It's useful in test cases where you need to perform an arbitrarily long sequence of actions.
func (*Test) PerformOne ¶
PerformOne randomly decides to either finish the test, or to perform a random action.
func (*Test) ShouldContinue ¶
ShouldContinue returns whether we should continue with the test.