| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Plutarch.Test.Unit
Description
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: 1.0.0
testEval :: TestName -> ClosedTerm a -> TestTree Source #
Assert that term compiled and evaluated without errors
Since: 1.0.0
testEvalFail :: TestName -> ClosedTerm a -> TestTree Source #
Assert that term compiled correctly but evaluated with errors
Since: 1.0.0
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: 1.0.0
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: 1.0.0
data TermResult Source #
Since: 1.0.0
Constructors
| FailedToCompile Text | |
| FailedToEvaluate EvalError [Text] | |
| Evaluated String [Text] |
evalTermResult :: Config -> ClosedTerm a -> TermResult Source #
Since: 1.0.0