A rule is one possible action in a stateful test.
More...
#include <stateful.h>
|
| | Rule (std::string name, std::function< void(TestCase &, T &)> step) |
| | Declares a new Rule.
|
| const std::string & | name () const |
| | Returns the name of the rule.
|
| const std::function< void(TestCase &, T &)> & | step () const |
| | Returns the underlying step function of the rule.
|
template<typename T>
class hegel::stateful::Rule< T >
A rule is one possible action in a stateful test.
stack.push_back(tc.draw(gs::integers<int>()));
});
Handle to the currently-executing test case.
Definition test_case.h:40
A rule is one possible action in a stateful test.
Definition stateful.h:289
- Template Parameters
-
| T | The state-machine type the rule acts on |
◆ Rule()
Declares a new Rule.
- Parameters
-
| name | name of the rule |
| step | function representing the step a rule takes. It mutates the state in place, drawing any arguments it needs from the test case. Always check preconditions with assume() before mutating. A rule that rejects after mutating leaves the state partially modified. |
◆ name()
Returns the name of the rule.
- Returns
- const std::string&
◆ step()
Returns the underlying step function of the rule.
- Returns
- const std::function<void(TestCase&, T&)>&
The documentation for this class was generated from the following file: