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 expectFailure combinator #72

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

palas
Copy link
Contributor

@palas palas commented Sep 24, 2024

This PR adds a new combinator that when applied to a property it will invert its behaviour:

  • If the property fails, the new property will pass
  • If the property passes, the new property will fail

This is useful for writing negative tests

See the following PR for an example of usage: IntersectMBO/cardano-cli#910

Based on equivalent QuickCheck combinator: https://hackage.haskell.org/package/QuickCheck-2.15.0.1/docs/Test-QuickCheck.html#v:expectFailure

@palas palas force-pushed the add-expect-failure branch from 8ea37f3 to 873fcf3 Compare October 16, 2024 13:24
@palas palas force-pushed the add-expect-failure branch from 1201243 to 792817f Compare February 5, 2025 16:01
@palas palas force-pushed the add-expect-failure branch from 792817f to 6b40d2d Compare February 5, 2025 16:06
@palas palas deployed to cabal-cache February 5, 2025 16:06 — with GitHub Actions Active
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