-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Simplify API #331
Comments
Hi @gunar, First of all thanks for the suggestions. Here are my feedbacks concerning those ones:
I believe the split between One of the advantages is that you can easily change
I think the best thing would be to provide wrapper specific for each framework as I already did for https://github.com/dubzzz/ava-fast-check/ or am trying to do with jestjs/jest#8035 Here are some examples taken from different projects in different programming languages:
@Test
def propertyDoNotHoldOnInfiniteStreams() {
val inputGen = /* ... */
check(Prop.forAll(inputGen) {gens: (List[Int], Int) => gens match {
case (l, num) => LineRound.ofInt.merge_tiles(Stream.continually(l.toStream).flatten).take(num).size == num
}})
}
it(name, function () {
jsc.assert(jsc.forall(...));
}
check(
property(
gen.int, gen.int,
(a, b) => a + b >= a && a + b >= b
)
)
I am not really fond of using primitive
Moreover it will highly complexify all the typings and require lots of changes to have it everywhere. Additionally there is no certainty that the users of fast-check building additional wrappers (wrappers similar to
Feel free to suggest the associated change in the documentation with a PR. So that we could discuus your suggestion together. The easier the documentation the better. |
@gunar Any updates? Any feedbacks? |
Not really, your answer pretty much nailed it. Thanks @dubzzz. |
The current API is expressive enough, but I believe it could be made more appealing to people new to PBT.
I suggest
fc.assert
andfc.property
intofc.test
.pre()
earlier on in the documentation.@dubzzz what do you think?
The text was updated successfully, but these errors were encountered: