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.
-
The built-in arbitrary
fc.set
is 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
Set
butArray
.The aim of this discussion is to find a better name for those "arrays of unique values". I was thinking about:
fc.uniqueArray
fc.unique
Renaming 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