Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect filter to rejection mechanisms like fc.pre does #4660

Open
dubzzz opened this issue Jan 29, 2024 · 0 comments
Open

Connect filter to rejection mechanisms like fc.pre does #4660

dubzzz opened this issue Jan 29, 2024 · 0 comments

Comments

@dubzzz
Copy link
Owner

dubzzz commented Jan 29, 2024

馃挕 Idea

Provide a built-in way to work with infinite loops in filter.

Motivation

On its own filter might easily lead to infinite loops when predicates are wrongly defined. Contrary to fc.pre it does not stop itself from running when it reached to many tries to generate something.

As reported in #4659, it could be great to have something for filter.

Example

Here are some possible options that came to my mind:

  • Option 1: Provide something like buildStoppeable.
  • Option 2: Connect it directly in Arbitrary.prototype.filter (we have to measure the performance cost if we go in that direction).

Whatever the option it could be great to have the following:

  • Same policy as fc.pre: it should rely on the very same configuration (to be confirmed).
  • Should not destroy performance
  • Should not tied arbitraries with properties too deeply
  • Should be reported properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant