Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- mapTestLimit ∷ (TestLimit → TestLimit) → Property → Property
- withAtLeastTests ∷ TestLimit → Property → Property
- mapTestLimitAtLeast ∷ TestLimit → (TestLimit → TestLimit) → Property → Property
- checkFails ∷ Property → IO ()
- isSerialisable ∷ Some (ValueOf DefaultUni) → Bool
- class ToTPlc a uni fun | a → uni fun where
- class ToUPlc a uni fun | a → uni fun where
- pureTry ∷ Exception e ⇒ a → Either e a
- catchAll ∷ a → ExceptT SomeException IO a
- rethrow ∷ ExceptT SomeException IO a → IO a
- runTPlc ∷ ToTPlc a DefaultUni DefaultFun ⇒ [a] → ExceptT SomeException IO (EvaluationResult (Term TyName Name DefaultUni DefaultFun ()))
- runUPlc ∷ ToUPlc a DefaultUni DefaultFun ⇒ [a] → ExceptT SomeException IO (Term Name DefaultUni DefaultFun ())
- runUPlcLogs ∷ ToUPlc a DefaultUni DefaultFun ⇒ [a] → ExceptT SomeException IO [Text]
- ppCatch ∷ PrettyPlc a ⇒ ExceptT SomeException IO a → IO (Doc ann)
- ppCatchReadable ∷ ∀ a ann. PrettyBy (PrettyConfigReadable PrettyConfigName) a ⇒ ExceptT SomeException IO a → IO (Doc ann)
- goldenTPlc ∷ ToTPlc a DefaultUni DefaultFun ⇒ String → a → TestNested
- goldenTPlcReadable ∷ ToTPlc a DefaultUni DefaultFun ⇒ String → a → TestNested
- goldenUPlc ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → a → TestNested
- goldenUPlcReadable ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → a → TestNested
- goldenTEval ∷ ToTPlc a DefaultUni DefaultFun ⇒ String → [a] → TestNested
- goldenUEval ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → [a] → TestNested
- goldenUEvalLogs ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → [a] → TestNested
- goldenUEvalProfile ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → [a] → TestNested
- goldenUEvalProfile' ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → [a] → TestNested
- goldenUEvalBudget ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → [a] → TestNested
- goldenSize ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → a → TestNested
- initialSrcSpan ∷ FilePath → SrcSpan
- topSrcSpan ∷ SrcSpan
- newtype NoMarkRenameT ren m a = NoMarkRenameT {
- unNoMarkRenameT ∷ RenameT ren m a
- noMarkRename ∷ Monoid ren ⇒ (t → NoMarkRenameT ren m t) → t → m t
- newtype NoRenameT (ren ∷ Type) m a = NoRenameT {
- unNoRenameT ∷ m a
- noRename ∷ MonadQuote m ⇒ (t → m ()) → (t → NoRenameT ren m t) → t → m t
- newtype BrokenRenameT ren m a = BrokenRenameT {
- unBrokenRenameT ∷ StateT ren m a
- runBrokenRenameT ∷ (Monad m, Monoid ren) ⇒ BrokenRenameT ren m a → m a
- brokenRename ∷ (MonadQuote m, Monoid ren) ⇒ (t → m ()) → (t → BrokenRenameT ren m t) → t → m t
- data Prerename
- data BindingRemoval
- prop_scopingFor ∷ (PrettyPlc (t NameAnn), Rename (t NameAnn), Scoping t) ⇒ AstGen (t ann) → BindingRemoval → Prerename → (t NameAnn → Quote (t NameAnn)) → Property
- test_scopingGood ∷ (PrettyPlc (t NameAnn), Rename (t NameAnn), Scoping t) ⇒ String → AstGen (t ann) → BindingRemoval → Prerename → (t NameAnn → Quote (t NameAnn)) → TestTree
- test_scopingBad ∷ (PrettyPlc (t NameAnn), Rename (t NameAnn), Scoping t) ⇒ String → AstGen (t ann) → BindingRemoval → Prerename → (t NameAnn → Quote (t NameAnn)) → TestTree
- test_scopingSpoilRenamer ∷ (PrettyPlc (t NameAnn), Rename (t NameAnn), Scoping t, Monoid ren) ⇒ AstGen (t ann) → (t NameAnn → Quote ()) → (∀ m. (MonadQuote m, MonadReader ren m) ⇒ t NameAnn → m (t NameAnn)) → TestTree
- module Test.Tasty.Extras
Documentation
withAtLeastTests ∷ TestLimit → Property → Property Source #
Set the number of times a property should be executed before it is considered successful, unless it's already higher than that.
mapTestLimitAtLeast ∷ TestLimit → (TestLimit → TestLimit) → Property → Property Source #
Set the number of times a property should be executed before it is considered successful, unless the given function scales it higher than that.
isSerialisable ∷ Some (ValueOf DefaultUni) → Bool Source #
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 Source #
Class for ad-hoc overloading of things which can be turned into a PLC program. Any errors from the process should be caught.
Instances
ToTPlc a uni fun ⇒ ToTPlc (ExceptT SomeException IO a) uni fun Source # | |
Defined in PlutusCore.Test | |
ToTPlc (Program TyName Name uni fun ()) uni fun Source # | |
(GEq uni, Typecheckable uni fun, PrettyUni uni, Pretty fun, Pretty a, Typeable a, Ord a, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun)) ⇒ ToTPlc (Program TyName Name uni fun a) uni fun Source # | |
class ToUPlc a uni fun | a → uni fun where Source #
Instances
ToUPlc a uni fun ⇒ ToUPlc (ExceptT SomeException IO a) uni fun Source # | |
Defined in PlutusCore.Test | |
ToUPlc (Program NamedDeBruijn uni fun ()) uni fun Source # | |
Defined in PlutusCore.Test toUPlc ∷ Program NamedDeBruijn uni fun () → ExceptT SomeException IO (Program Name uni fun ()) Source # | |
ToUPlc (Program Name uni fun ()) uni fun Source # | |
(Typecheckable uni fun, Hashable fun) ⇒ ToUPlc (Program TyName Name uni fun ()) uni fun Source # | |
(GEq uni, Typecheckable uni fun, PrettyUni uni, Pretty fun, Hashable fun, Pretty a, Typeable a, Ord a, Default (CostingPart uni fun), Default (BuiltinsInfo uni fun), Default (RewriteRules uni fun)) ⇒ ToUPlc (Program TyName Name uni fun a) uni fun Source # | |
runTPlc ∷ ToTPlc a DefaultUni DefaultFun ⇒ [a] → ExceptT SomeException IO (EvaluationResult (Term TyName Name DefaultUni DefaultFun ())) Source #
runUPlc ∷ ToUPlc a DefaultUni DefaultFun ⇒ [a] → ExceptT SomeException IO (Term Name DefaultUni DefaultFun ()) Source #
runUPlcLogs ∷ ToUPlc a DefaultUni DefaultFun ⇒ [a] → ExceptT SomeException IO [Text] Source #
ppCatchReadable ∷ ∀ a ann. PrettyBy (PrettyConfigReadable PrettyConfigName) a ⇒ ExceptT SomeException IO a → IO (Doc ann) Source #
goldenTPlc ∷ ToTPlc a DefaultUni DefaultFun ⇒ String → a → TestNested Source #
goldenTPlcReadable ∷ ToTPlc a DefaultUni DefaultFun ⇒ String → a → TestNested Source #
goldenUPlc ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → a → TestNested Source #
goldenUPlcReadable ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → a → TestNested Source #
goldenTEval ∷ ToTPlc a DefaultUni DefaultFun ⇒ String → [a] → TestNested Source #
goldenUEval ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → [a] → TestNested Source #
goldenUEvalLogs ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → [a] → TestNested Source #
goldenUEvalProfile ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → [a] → TestNested Source #
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 DefaultUni DefaultFun ⇒ String → [a] → TestNested Source #
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 DefaultUni DefaultFun ⇒ String → [a] → TestNested Source #
goldenSize ∷ ToUPlc a DefaultUni DefaultFun ⇒ String → a → TestNested Source #
newtype NoMarkRenameT ren m a Source #
A version of RenameT
that fails to take free variables into account.
NoMarkRenameT | |
|
Instances
noMarkRename ∷ Monoid ren ⇒ (t → NoMarkRenameT ren m t) → t → m t Source #
newtype NoRenameT (ren ∷ Type) m a Source #
A version of RenameT
that does not perform any renaming at all.
NoRenameT | |
|
Instances
(Monad m, Monoid ren) ⇒ MonadReader ren (NoRenameT ren m) Source # | |
Alternative m ⇒ Alternative (NoRenameT ren m) Source # | |
Applicative m ⇒ Applicative (NoRenameT ren m) Source # | |
Defined in PlutusCore.Test pure ∷ a → NoRenameT ren m a Source # (<*>) ∷ NoRenameT ren m (a → b) → NoRenameT ren m a → NoRenameT ren m b Source # liftA2 ∷ (a → b → c) → NoRenameT ren m a → NoRenameT ren m b → NoRenameT ren m c Source # (*>) ∷ NoRenameT ren m a → NoRenameT ren m b → NoRenameT ren m b Source # (<*) ∷ NoRenameT ren m a → NoRenameT ren m b → NoRenameT ren m a Source # | |
Functor m ⇒ Functor (NoRenameT ren m) Source # | |
Monad m ⇒ Monad (NoRenameT ren m) Source # | |
MonadQuote m ⇒ MonadQuote (NoRenameT ren m) Source # | |
noRename ∷ MonadQuote m ⇒ (t → m ()) → (t → NoRenameT ren m t) → t → m t Source #
newtype BrokenRenameT ren m a Source #
A broken version of RenameT
whose local
updates the scope globally
(as opposed to locally).
BrokenRenameT | |
|
Instances
runBrokenRenameT ∷ (Monad m, Monoid ren) ⇒ BrokenRenameT ren m a → m a Source #
brokenRename ∷ (MonadQuote m, Monoid ren) ⇒ (t → m ()) → (t → BrokenRenameT ren m t) → t → m t Source #
Determines whether to perform renaming before running the scoping tests. Needed for passes that don't perform renaming themselves.
data BindingRemoval Source #
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
Show BindingRemoval | |
Defined in PlutusCore.Check.Scoping | |
Eq BindingRemoval | |
Defined in PlutusCore.Check.Scoping (==) ∷ BindingRemoval → BindingRemoval → Bool Source # (/=) ∷ BindingRemoval → BindingRemoval → Bool Source # |
∷ (PrettyPlc (t NameAnn), Rename (t NameAnn), 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 |
→ (t NameAnn → Quote (t NameAnn)) | The runner of the pass. |
→ Property |
Test scoping for a renamer.
∷ (PrettyPlc (t NameAnn), Rename (t NameAnn), 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 |
→ (t NameAnn → Quote (t NameAnn)) | The runner of the pass. |
→ TestTree |
Test that a pass does not break global uniqueness.
∷ (PrettyPlc (t NameAnn), Rename (t NameAnn), 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 |
→ (t NameAnn → Quote (t NameAnn)) | The runner of the pass. |
→ TestTree |
Test that a pass breaks global uniqueness.
test_scopingSpoilRenamer ∷ (PrettyPlc (t NameAnn), Rename (t NameAnn), Scoping t, Monoid ren) ⇒ AstGen (t ann) → (t NameAnn → Quote ()) → (∀ m. (MonadQuote m, MonadReader ren m) ⇒ t NameAnn → m (t NameAnn)) → TestTree Source #
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
module Test.Tasty.Extras