Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Utilities for unit testing plutarch terms
Synopsis
- testCompileFail :: TestName -> ClosedTerm a -> TestTree
- testEval :: TestName -> ClosedTerm a -> TestTree
- testEvalFail :: TestName -> ClosedTerm a -> TestTree
- testEvalEqual :: TestName -> ClosedTerm a -> ClosedTerm a -> TestTree
- testEvalEqualTraces :: TestName -> ClosedTerm a -> LogLevel -> [Text] -> TestTree
- data TermResult
- = FailedToCompile Text
- | FailedToEvaluate EvalError [Text]
- | Evaluated String [Text]
- evalTermResult :: Config -> ClosedTerm a -> TermResult
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
:: 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
FailedToCompile Text | |
FailedToEvaluate EvalError [Text] | |
Evaluated String [Text] |
evalTermResult :: Config -> ClosedTerm a -> TermResult Source #
@since WIP