plutarch-testlib-1.0.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Test.Unit

Description

Utilities for unit testing plutarch terms

Synopsis

Documentation

testCompileFail :: TestName -> ClosedTerm a -> TestTree Source #

Assert that term failed to compile

@since WIP

testEval :: TestName -> ClosedTerm a -> TestTree Source #

Assert that term compiled and evaluated without errors

@since WIP

testEvalFail :: TestName -> ClosedTerm a -> TestTree Source #

Assert that term compiled correctly but evaluated with errors

@since WIP

testEvalEqual Source #

Arguments

:: TestName 
-> ClosedTerm a

Actual

-> ClosedTerm a

Expected

-> TestTree 

Assert that term compiled and evaluated without errors and matches the expected value note that comparison is done on AST level, not by Eq or PEq

@since WIP

testEvalEqualTraces :: TestName -> ClosedTerm a -> LogLevel -> [Text] -> TestTree Source #

Assert that term compiled (with specified tracing level and DetTracing) and evaluated without errors produced traces that match expected value. Note that this succeeds even if script evaluated to error if traces still match

@since WIP

data TermResult Source #

@since WIP

evalTermResult :: Config -> ClosedTerm a -> TermResult Source #

@since WIP