Skip to content

Conversation

@konsumlamm
Copy link
Contributor

Use === instead of ==, since it prints a counterexample on test failure and use Positive/NonEmpty instead of ==> to avoid discarded test cases.

@treeowl
Copy link
Collaborator

treeowl commented Dec 17, 2025

This is strictly cleaner. Using Positive will definitely reduce discarded values, since its Arbitrary instance takes the absolute value before verifying it has a positive result. NonEmptyList does the naive thing, so using it won't change performance, but it still seems nicer to use it.

@andrewthad
Copy link
Collaborator

Agreed about this being cleaner. It's strange that somehow, quickcheck has ended up doing the sensible thing for NonEmpty but the naive thing for NonEmptyList. But I'll leave that up to the quickcheck maintainers to improve one day.

Merging.

@andrewthad andrewthad merged commit b866484 into haskell:master Dec 17, 2025
13 checks passed
@konsumlamm konsumlamm deleted the test-improvement branch December 17, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants