| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Evaluation.Builtins.Bitwise.Conformance
Description
Share Hedgehog inputs and terms between assertions and conformance generation.
Synopsis
- data Check
- checkSame ∷ PlcTerm → PlcTerm → Gen Check
- checkConstant ∷ ∀ a. Contains DefaultUni a ⇒ a → PlcTerm → Gen Check
- checkProperty ∷ Gen Check → Property
- genByteString ∷ Int → Int → Gen ByteString
- genByteStringThat ∷ (ByteString → Bool) → Int → Int → Gen ByteString
- generateBitwisePropertyFiles ∷ OutputFormat → CheckMode → FilePath → Int → QCGen → PropertyId → String → Gen Check → IO Generated
Documentation
A property check expressed without performing it. Normal QuickCheck suites
interpret it as an assertion, the Hedgehog suites have their own interpreter,
and the test generator extracts its terms, first checking with checkHolds that
the reference implementation satisfies the property for the sampled input.
Constructors
| CheckEq PlcTerm PlcTerm | Both terms evaluate successfully to equal results. |
| CheckEvaluatesTo PlcTerm TypeErrorOrCekResult | The term evaluates to the given result. |
| CheckTrue PlcTerm | The term evaluates successfully to |
| CheckOk PlcTerm | The term evaluates successfully. |
| CheckFails PlcTerm | The term fails to evaluate. |
| CheckBoth Check Check | Both checks must hold. When generating, each check contributes its own numbered cases, so one sampled input can use several numbers. |
| CheckImplies Bool Check | |
| CheckDistinct [PlcTerm] | All terms evaluate successfully to pairwise distinct results. |
| CheckSatisfies String PlcTerm (TypeErrorOrCekResult → Bool) | The term's result satisfies the predicate, labelled for failure reports. |
checkConstant ∷ ∀ a. Contains DefaultUni a ⇒ a → PlcTerm → Gen Check Source #
Compare a term's result with a constant. The constant is only used by the normal tests; the generated tests export the term alone.
checkProperty ∷ Gen Check → Property Source #
Keep Hedgehog's input shrinking and normal assertion reporting.
genByteString ∷ Int → Int → Gen ByteString Source #
genByteStringThat ∷ (ByteString → Bool) → Int → Int → Gen ByteString Source #
generateBitwisePropertyFiles ∷ OutputFormat → CheckMode → FilePath → Int → QCGen → PropertyId → String → Gen Check → IO Generated Source #
Sample Hedgehog generators directly, with seeds derived from the executable's QuickCheck seed. No property runner or assertions are involved. Discarded inputs are retried, and the lazy stream stops at the requested case count. Equality cases retain both terms, numbered together with -A/-B suffixes.