plutus-core-1.72.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Evaluation.Builtins.Integer.Conformance

Description

Assertions and specifications shared by normal integer properties and conformance generators.

Synopsis

Documentation

data Check Source #

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 True.

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.

Instances

Instances details
Testable Check Source # 
Instance details

Defined in Evaluation.Builtins.Conformance

Methods

property ∷ Check → Property #

propertyForAllShrinkShow ∷ Gen a → (a → [a]) → (a → [String]) → (a → Check) → Property #

Show Check Source #

Shows the terms of a check; the predicate of CheckSatisfies is omitted.

Instance details

Defined in Evaluation.Builtins.Conformance

data PropertyReport Source #

A property together with the cases written for it.

data PropertySpec gen Source #

A property with the identifier and description shared by the normal test suite and the conformance generator, together with the sampler that produces its inputs.

Constructors

PropertySpec 

Fields

generatePropertySpecs ∷ OutputFormat → CheckMode → PropertyFilter → FilePath → Int → QCGen → [String] → [PropertySpec (Gen Check)] → IO [PropertyReport] Source #

Generate the requested number of cases for every selected property, writing them below the suite directory.

propertySpec ∷ GenerateCases prop ⇒ String → TestName → prop → PropertySpec (Gen Check) Source #

A property described once and used by both the test suite and the conformance test generator. The identifier is the stable test case name; the description is what the test runner displays.

propertySpecPropertyIds ∷ [String] → [PropertySpec gen] → [PropertyId] Source #

Generated test case identifiers for a suite's properties, in declaration order.

testPropertySpecs ∷ (Property → Property) → [PropertySpec (Gen Check)] → [TestTree] Source #

Tasty tests for a group of properties, applying a limit to each.