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
I encountered this strange behaviour today. Given the following code:
property "some property" do
forall i <- integer() do
IO.inspect(i, label: "i")
test_some_property()
end
end
property "some other property" do
forall i <- integer() do
IO.inspect(i, label: "ii")
test_some_property()
end
test_some_other_property()
end
defp test_some_property do
true
end
defp test_some_other_property do
true
end
only the code block with the label: i with be executed. Obviously it makes little sense to have test_some_other_property() after the forall but given my code was more complex than the example it took me a while to find the problem.
Is that the expected behaviour? Would it make sense to give a warning or error?
The text was updated successfully, but these errors were encountered:
Hi @pallix ,
nice catch, this is similar to #112. We should warn about that in the documentation. Since propcheck relies heavily on macros and code generation, it could be difficult to identify that situation (i.e. the Elixir compiler does not detect that situation, so we would have to do that by ourselves).
I encountered this strange behaviour today. Given the following code:
only the code block with the
label: i
with be executed. Obviously it makes little sense to havetest_some_other_property()
after theforall
but given my code was more complex than the example it took me a while to find the problem.Is that the expected behaviour? Would it make sense to give a warning or error?
The text was updated successfully, but these errors were encountered: