Let's find another name for fc.set
#1985
Replies: 3 comments 1 reply
-
|
IMO uniqueness is an orthogonal aspect of all kinds of collections. So I’d go with some kind of fluent API, e.g. fc.array().withUniqueElements(). But I’m biased, jqwik is doing it like that: https://jqwik.net/docs/current/user-guide.html#uniqueness-constraints |
Beta Was this translation helpful? Give feedback.
-
|
So far, in an attempt to stay aligned with the other existing APIs, I'll probably go for But fluent APIs or a |
Beta Was this translation helpful? Give feedback.
-
|
The final choice went for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The built-in arbitrary
fc.setis able to generate arrays of unique values. Unicity is defaulted by===(might change forObject.is) and can be overriden easily by anything else.But it has one naming issue: it does not produce
SetbutArray.The aim of this discussion is to find a better name for those "arrays of unique values". I was thinking about:
fc.uniqueArrayfc.uniqueRenaming it would make future versions of fast-check able to re-use it for real instances of
Set.Beta Was this translation helpful? Give feedback.
All reactions