Closed josevalim closed 7 years ago
Good point on the inconsistency. However, gen all
is quite useful to build complex generators and generators are not meant to be used in property testing only so I am not sure that moving it out of StreamData
is a good idea.
@whatyouhide we can always find a way to add them back to StreamData if necessary later.
I guess one of the related questions is how we are going to bring generators into the test code too.
@josevalim right now property "foo" do end
imports StreamData
inside its body and that's how we use generators when writing properties, but this does not work well for defining generators outside of properties (which I would say it's a pretty common thing to do).
@whatyouhide right. that's why i was thinking that if you want property tests you should do use ExUnit.Properties
(to mirror ExUnit.Assertions
) and that would import gen+check all as well all generators and the property/2 macro.
Sounds great to me. @josevalim wdyt of 1. renaming PropertyTest
to ExUnitProperties
, and 2. move gen all
to there?
@whatyouhide yes. We should probably get a :+1: from @ericmj and @lexmag in the name as well.
ExUnit.Properties
seems very intuitive name to me. 👍
It is a bit awkward to see those functions side by side when it comes to their name inconsistencies. One option is to move the
gen
function back to the PropertyTest module since right now it relies exclusively on public APIs.