New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
int/2 generator is broken #40
Comments
This test fails with the current code base: prop_intrange() ->
?FORALL({X,Y},
?SUCHTHAT({XX,YY},
{int(), int()},
XX < YY),
true = triq:counterexample( prop_intrange(X,Y))).
prop_intrange(X,Y) when X < Y ->
?FORALL(I, int(X,Y),
?WHENFAIL(io:format("Min=~p, Max=~p, I=~p~n", [X,Y,I]),
(I >= X) andalso (I =< Y))). Basically, it just invokes trip recursively for each set of The failure looks like this:
Now try fixing that :-) |
Wow that's much better yes. I will do that now. |
See #41. |
Thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
The following property:
gives the following output:
As you can see the max limit is not enforced as one would expect. This makes generating integers between 1 and 12 difficult.
Changing "max" into "min" in the int/2 function seems to solve the problem:
If this seems correct I would like to submit a patch for this, but I am not sure how to write a test for it. Would using
triq_dom:sample
in a loop (run 100 times for example) be good enough? The only test seemingly similar I can see tests for boolean only.The text was updated successfully, but these errors were encountered: