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

PlutusCore.Test

Synopsis
  • mapTestLimit :: (NameAnn)) -> Property #

    Set the number of times a property should be executed before it is considered successful, unless it's already higher than that.

mapTestLimitAtLeast :: Property #

Set the number of times a property should be executed before it is considered successful, unless the given function scales it higher than that.

checkFails :: DefaultUni) -> Bool #

Check whether the given constant can be serialised. Useful for tests of the parser/deserializer where we need to filter out unprintable/unserialisable terms. Technically, G1, G2 elements etc can be printed but not serialised, but here for simplicity we just assume that all unserialisable terms are unprintable too.

class ToTPlc a uni fun | a -> uni fun where #

Class for ad-hoc overloading of things which can be turned into a PLC program. Any errors from the process should be caught.

Methods

toTPlc :: a -> DefaultFun => TestName -> [a] -> TestNested #

This is mostly useful for profiling a test that is normally tested with one of the other functions, as it's a drop-in replacement and you can then pass the output into traceToStacks.

goldenUEvalProfile' :: ToUPlc a DefaultFun => TestName -> [a] -> TestNested #

This is mostly useful for profiling a test that is normally tested with one of the other functions, as it's a drop-in replacement and you can then pass the output into traceToStacks.

goldenUEvalBudget :: ToUPlc a MonadQuote m => (t -> m ()) -> (t -> NoRenameT ren m t) -> t -> m t #

newtype BrokenRenameT ren m a #

A broken version of RenameT whose local updates the scope globally (as opposed to locally).

Constructors

BrokenRenameT 

Fields

data Prerename #

Determines whether to perform renaming before running the scoping tests. Needed for passes that don't perform renaming themselves.

Constructors

PrerenameYes 
PrerenameNo 

data BindingRemoval #

Whether it's OK if the pass removes bindings. A renamer isn't supposed to do that, but for example an inliner may do it, since it's basically the entire point of an inliner.

Instances

Instances details
Scoping t) 
=> AstGen (t ann)

A generator of types/terms/programs.

-> BindingRemoval

Whether binding removal is expected for the pass.

-> Prerename

Whether renaming is required before running the scoping tests. Note that the scoping tests rely on global uniqueness themselves, hence for any pass that doesn't perform renaming internally this needs to be PrerenameYes.

-> (t Scoping t) 
=> String

The name of the pass we're about to test.

-> AstGen (t ann)

A generator of types/terms/programs.

-> BindingRemoval

Whether binding removal is expected for the pass.

-> Prerename

Whether renaming is required before running the scoping tests. Note that the scoping tests rely on global uniqueness themselves, hence for any pass that doesn't perform renaming internally this needs to be PrerenameYes.

-> (t Scoping t) 
=> String

The name of the pass we're about to test.

-> AstGen (t ann)

A generator of types/terms/programs.

-> BindingRemoval

Whether binding removal is expected for the pass.

-> Prerename

Whether renaming is required before running the scoping tests. Note that the scoping tests rely on global uniqueness themselves, hence for any pass that doesn't perform renaming internally this needs to be PrerenameYes.

-> (t NameAnn)) -> TestTree #

Test that the scoping machinery fails when the given renamer is spoiled in some way (e.g. marking is removed) to ensure that the machinery does catch bugs.

Tasty extras

Orphan instances