You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off: thanks for fscheck! It's been a great library so far :)
Not exactly sure what's going on here, but I've managed to narrow it down to the following reproduction based on the C# Counter example in the docs:
summary of changes
Counter becomes PositiveCounter (throws if you attempt to decrement below zero)
Dec command class now has a precondition to avoid trying to decrement below zero in the test
the plain int model becomes a mutable class IntModel (this is to represent my actual use case where I needed to use a List<T> as the model)
this part in particular appears to be required to reproduce the issue
expected behavior: the test should pass (because I've not included the original bug in Counter from the docs)
actual behavior: the spec attempts to decrement before incrementing:
Yes it's not advisable to use mutable types as the model, this will confuse the thing endlessly. Try using ImmutableList instead, or cloning the model before returning it.
Makes sense I guess, but it's kind of strange that the implementation class in a spec can be mutable while the model class must be immutable. Maybe this can be made explicit in the docs?
First off: thanks for fscheck! It's been a great library so far :)
Not exactly sure what's going on here, but I've managed to narrow it down to the following reproduction based on the C# Counter example in the docs:
summary of changes
Counter
becomesPositiveCounter
(throws if you attempt to decrement below zero)Dec
command class now has a precondition to avoid trying to decrement below zero in the testint
model becomes a mutable classIntModel
(this is to represent my actual use case where I needed to use aList<T>
as the model)this part in particular appears to be required to reproduce the issue
expected behavior: the test should pass (because I've not included the original bug in Counter from the docs)
actual behavior: the spec attempts to decrement before incrementing:
The text was updated successfully, but these errors were encountered: