explainable-predicates - Predicates that can explain themselves
Explainable predicates
are essentially functions from types to Bool which can additionally describe
themselves and explain why an argument does or doesn’t match. They are intended
to be used during unit tests to provide better error messages when tests fail.
For example, if a collection is missing an element, an explainable predicate can
tell you which element is missing.
FAQ
Here are a few tips for making the most of explainable-predicates.
Which GHC versions are supported?
explainable-predicates is tested with GHC versions from 8.6 through 9.4.
Changes
Revision history for explainable-predicates
0.1.2.3 – 2021-09-18
Version bounds now allow GHC 9.4
0.1.2.2 – 2021-12-20
Better error messages for HUnit integration.
0.1.2.1 – 2021-12-20
Builds with GHC 9.2.1
0.1.2.0 – 2021-09-25
HUnit and Hspec integration is now available in Test.Predicates.HUnit.
0.1.1.0 – 2021-09-25
Predicate now has a Contravariant instance.
==~ is an infix synonym for accept.
Cabal regex and containers flags (default true) enable regex and
container predicates, respectively.
Cabal dev flag (default false) turns GHC warnings into errors.
The inBranch and qADT combinators are now available for more convenient
matching of algebraic data types and fields.
QuickCheck integration is now available in Test.Predicates.QuickCheck.