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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Functions #7

Open
Befrish opened this issue Oct 21, 2020 · 3 comments
Open

Add support for Functions #7

Befrish opened this issue Oct 21, 2020 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@Befrish
Copy link
Collaborator

Befrish commented Oct 21, 2020

  • CheckedConsumer
  • CheckedPredicate
  • CheckedRunnable
  • CheckedFunction0 - 8
  • Function0 - 8
@Befrish Befrish added the enhancement New feature or request label Oct 21, 2020
@Befrish Befrish added this to the 1.1.0 milestone Oct 21, 2020
@jlink
Copy link
Contributor

jlink commented Mar 11, 2023

Since functional interfaces are supported by jqwik out of the box, what additional functionality could there be?

For example:

@Property
void testCheckedPredicate(@ForAll CheckedPredicate<String> predicate) throws Throwable {
	assertThat(predicate.test("hallo"), equalTo(predicate.test("hallo")));
	Statistics.collect(predicate.test("hallo"));
}

will succeed and output something like:

[Experiments:testCheckedPredicate] (1000) statistics = 
    true  (501) : 50 %
    false (499) : 50 %

@Befrish
Copy link
Collaborator Author

Befrish commented Mar 12, 2023

I will have a look at this

@Befrish
Copy link
Collaborator Author

Befrish commented Mar 12, 2023

@jlink What result do you expect? If I change it to java.util.function.Predicate. There are nearly the same result (about 50:50).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants