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

PlutusCore.Generators.Hedgehog.Test

Description

This module defines functions useful for testing.

Synopsis

getSampleTermValue :: (uni Name uni fun ())) #

Generate a program using a given generator and check that it's well-typed and evaluates correctly.

printSampleProgramAndValue :: (uni Name uni fun ()) a) => TermGen a -> IO () #

Generate a program using a given generator, check that it's well-typed and evaluates correctly and pretty-print it to stdout using the default pretty-printing mode.

sampleProgramValueGolden #

Arguments

:: (uni Name uni fun ()) a) 
=> String
folder
-> String
name
-> TermGen a

A term generator.

-> IO () 

Generate a pair of files: folder.name.plc and folder.name.plc.golden. The first file contains a term generated by a term generator (wrapped in Program), the second file contains the result of evaluation of the term.

propEvaluate #

Arguments

:: (uni Name uni fun ()))

An evaluator.

-> TermGen a

A term/value generator.

-> Property 

A property-based testing procedure for evaluators. Checks whether a term generated along with the value it's supposed to compute to indeed computes to that value according to the provided evaluate.