plutarch-testlib-1.0.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Test.Golden

Description

Utilities for golden testing

To regenerate golden tests it is enough to remove ./goldens directory and rerun tests

Synopsis

Documentation

data GoldenTestTree Source #

Opaque type representing tree of golden tests

@since WIP

plutarchGolden Source #

Arguments

:: TestName 
-> FilePath

Base file name of golden file path.

e.g. "foo" will result in goldens:

  • ./goldens/foo.bench.golden - With execution units and size
  • ./goldens/foo.uplc.eval.golden - With AST after evaluation
  • ./goldens/foo.uplc.golden - With AST before evaluation
-> [GoldenTestTree] 
-> TestTree 

Convert tree of golden tests into standard Tasty TestTree, capturing results produced by nested golden tests

@since WIP

goldenGroup :: TestName -> [GoldenTestTree] -> GoldenTestTree Source #

Like testGroup but for golden tests

Goldens in the group will be prefixed by the group name

@since WIP

goldenEval :: TestName -> ClosedTerm a -> GoldenTestTree Source #

Like testEval but will append to goldens created by enclosing plutarchGolden

@since WIP

goldenEvalFail :: TestName -> ClosedTerm a -> GoldenTestTree Source #

Like testEvalFail but will append to goldens created by enclosing plutarchGolden

@since WIP