StateMachineTest
's apply
method should use the current state, not the next state.
#488
Labels
quality-of-life
This issue proposes a change that will improve the UX of proptest but isn't necessarily a "feature"
Assuming that the model is implemented properly, it can be useful to have access to the model corresponding to the system under test before the transition is applied.
This is useful when the transition result depends on the current state. For example, when modeling an actual state machine, we may have certain side effects that only apply to specific states.
I think the current state should be provided and if needed, the user can apply the transition to the state to get the next one. This is how rapidcheck does it, for instance.
This can be currently emulated by keeping the current state as a field and explicitly passing the next state to the next SUT at the end of apply, but it's pretty cumbersome.
The text was updated successfully, but these errors were encountered: