plutarch-quickcheck-2.2.2: Quickcheck for Plutarch.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Plutarch.Test.QuickCheck

Synopsis

Documentation

type family PLamArgs (p :: S -> Type) :: [Type] where ... Source #

Extracts all TestableTerms from give Plutarch function.

Since: 2.0.0

Equations

PLamArgs (a :--> b) = TestableTerm a ': PLamArgs b 
PLamArgs _ = '[] 

data PA (s :: S) Source #

Placeholder for a polymorphic type. Plutarch equivalence of QuickCheck's A.

Since: 2.0.0

Instances

Instances details
PEq PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

(#==) :: forall (s :: S). Term s PA -> Term s PA -> Term s PBool Source #

POrd PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

PPartialOrd PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

(#<=) :: forall (s :: S). Term s PA -> Term s PA -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PA -> Term s PA -> Term s PBool Source #

PIsData PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PA) -> Term s PA Source #

pdataImpl :: forall (s :: S). Term s PA -> Term s PData Source #

DerivePlutusType PA Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

Associated Types

type DPTStrat PA Source #

PlutusType PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

pcon' :: forall (s :: S). PA s -> Term s (PInner PA) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PA) -> (PA s -> Term s b) -> Term s b Source #

PUnsafeLiftDecl PA Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

Associated Types

type PLifted PA = (r :: Type) Source #

PNum PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

(#+) :: forall (s :: S). Term s PA -> Term s PA -> Term s PA Source #

(#-) :: forall (s :: S). Term s PA -> Term s PA -> Term s PA Source #

(#*) :: forall (s :: S). Term s PA -> Term s PA -> Term s PA Source #

pnegate :: forall (s :: S). Term s (PA :--> PA) Source #

pabs :: forall (s :: S). Term s (PA :--> PA) Source #

psignum :: forall (s :: S). Term s (PA :--> PA) Source #

pfromInteger :: forall (s :: S). Integer -> Term s PA Source #

PShow PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

pshow' :: forall (s :: S). Bool -> Term s PA -> Term s PString Source #

PArbitrary PA Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

Generic (PA s) Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Associated Types

type Rep (PA s) :: Type -> Type Source #

Methods

from :: PA s -> Rep (PA s) x Source #

to :: Rep (PA s) x -> PA s Source #

type DPTStrat PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PContravariant' PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PContravariant' PA = All2 PContravariant'' (PCode PA)
type PCovariant' PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PCovariant' PA = All2 PCovariant'' (PCode PA)
type PInner PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PVariant' PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PVariant' PA = All2 PVariant'' (PCode PA)
type PLifted PA Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PLifted PA = A
type Rep (PA s) Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type Rep (PA s) = D1 ('MetaData "PA" "Plutarch.Test.QuickCheck" "plutarch-quickcheck-2.2.2-5YXLT0kSUiv5TkOiJvt3D7" 'True) (C1 ('MetaCons "PA" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PInteger))))

data PB (s :: S) Source #

Same as PA.

Since: 2.0.0

Instances

Instances details
PEq PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

(#==) :: forall (s :: S). Term s PB -> Term s PB -> Term s PBool Source #

POrd PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

PPartialOrd PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

(#<=) :: forall (s :: S). Term s PB -> Term s PB -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PB -> Term s PB -> Term s PBool Source #

PIsData PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PB) -> Term s PB Source #

pdataImpl :: forall (s :: S). Term s PB -> Term s PData Source #

DerivePlutusType PB Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

Associated Types

type DPTStrat PB Source #

PlutusType PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

pcon' :: forall (s :: S). PB s -> Term s (PInner PB) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PB) -> (PB s -> Term s b) -> Term s b Source #

PUnsafeLiftDecl PB Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

Associated Types

type PLifted PB = (r :: Type) Source #

PNum PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

(#+) :: forall (s :: S). Term s PB -> Term s PB -> Term s PB Source #

(#-) :: forall (s :: S). Term s PB -> Term s PB -> Term s PB Source #

(#*) :: forall (s :: S). Term s PB -> Term s PB -> Term s PB Source #

pnegate :: forall (s :: S). Term s (PB :--> PB) Source #

pabs :: forall (s :: S). Term s (PB :--> PB) Source #

psignum :: forall (s :: S). Term s (PB :--> PB) Source #

pfromInteger :: forall (s :: S). Integer -> Term s PB Source #

PShow PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

pshow' :: forall (s :: S). Bool -> Term s PB -> Term s PString Source #

PArbitrary PB Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

Generic (PB s) Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Associated Types

type Rep (PB s) :: Type -> Type Source #

Methods

from :: PB s -> Rep (PB s) x Source #

to :: Rep (PB s) x -> PB s Source #

type DPTStrat PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PContravariant' PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PContravariant' PB = All2 PContravariant'' (PCode PB)
type PCovariant' PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PCovariant' PB = All2 PCovariant'' (PCode PB)
type PInner PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PVariant' PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PVariant' PB = All2 PVariant'' (PCode PB)
type PLifted PB Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PLifted PB = B
type Rep (PB s) Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type Rep (PB s) = D1 ('MetaData "PB" "Plutarch.Test.QuickCheck" "plutarch-quickcheck-2.2.2-5YXLT0kSUiv5TkOiJvt3D7" 'True) (C1 ('MetaCons "PB" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PInteger))))

data PC (s :: S) Source #

Same as PA.

Since: 2.0.0

Instances

Instances details
PEq PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

(#==) :: forall (s :: S). Term s PC -> Term s PC -> Term s PBool Source #

POrd PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

PPartialOrd PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

(#<=) :: forall (s :: S). Term s PC -> Term s PC -> Term s PBool Source #

(#<) :: forall (s :: S). Term s PC -> Term s PC -> Term s PBool Source #

PIsData PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData PC) -> Term s PC Source #

pdataImpl :: forall (s :: S). Term s PC -> Term s PData Source #

DerivePlutusType PC Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

Associated Types

type DPTStrat PC Source #

PlutusType PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

pcon' :: forall (s :: S). PC s -> Term s (PInner PC) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PC) -> (PC s -> Term s b) -> Term s b Source #

PUnsafeLiftDecl PC Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

Associated Types

type PLifted PC = (r :: Type) Source #

PNum PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

(#+) :: forall (s :: S). Term s PC -> Term s PC -> Term s PC Source #

(#-) :: forall (s :: S). Term s PC -> Term s PC -> Term s PC Source #

(#*) :: forall (s :: S). Term s PC -> Term s PC -> Term s PC Source #

pnegate :: forall (s :: S). Term s (PC :--> PC) Source #

pabs :: forall (s :: S). Term s (PC :--> PC) Source #

psignum :: forall (s :: S). Term s (PC :--> PC) Source #

pfromInteger :: forall (s :: S). Integer -> Term s PC Source #

PShow PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Methods

pshow' :: forall (s :: S). Bool -> Term s PC -> Term s PString Source #

PArbitrary PC Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

Generic (PC s) Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Associated Types

type Rep (PC s) :: Type -> Type Source #

Methods

from :: PC s -> Rep (PC s) x Source #

to :: Rep (PC s) x -> PC s Source #

type DPTStrat PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PContravariant' PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PContravariant' PC = All2 PContravariant'' (PCode PC)
type PCovariant' PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PCovariant' PC = All2 PCovariant'' (PCode PC)
type PInner PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PVariant' PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PVariant' PC = All2 PVariant'' (PCode PC)
type PLifted PC Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type PLifted PC = C
type Rep (PC s) Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

type Rep (PC s) = D1 ('MetaData "PC" "Plutarch.Test.QuickCheck" "plutarch-quickcheck-2.2.2-5YXLT0kSUiv5TkOiJvt3D7" 'True) (C1 ('MetaCons "PC" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PInteger))))

punlam' :: forall (fin :: S -> Type) (p :: S -> Type). PUnLam fin p => (forall s. Term s p) -> PUnLamHask fin p Source #

Bring Plutarch function into the Haskell level with each Plutarch types wrapped in the TestableTerm.

Since: 2.1.0

punlam :: forall (fin :: S -> Type) (p :: S -> Type). PUnLam fin p => (forall s. Term s p) -> PUnLamHask fin p Source #

Same as punlam' but evaluates the given Plutarch function before the conversion. It will throw an error if evaluation fails.

Since: 2.1.0

fromPFun :: forall (p :: S -> Type). FromPFun PBool p => ClosedTerm p -> PLamWrapped (PUnLamHask PBool p) Source #

"Converts a Plutarch function into a Haskell function on TestableTerms, then wraps functions into PFun as necessary. The result will be 'Quickcheck-compatible' if all Plutarch types used have PArbitrary instances."

Since: 2.0.0

fromPPartial :: forall (p :: S -> Type). FromPFun POpaque p => ClosedTerm p -> PLamWrapped (PUnLamHask POpaque p) Source #

Same as fromPFun but it expects POpaque as the return type. It is helpful testing partial functions like PValidator.

Since: 2.1.6

fromFailingPPartial :: forall (p :: S -> Type). (PUnLam POpaque p, PWrapLam (PUnLamHask POpaque p), PExpectFailure (PLamWrapped (PUnLamHask POpaque p))) => ClosedTerm p -> PExpectingFail (PLamWrapped (PUnLamHask POpaque p)) Source #

Same as fromPPartial but it test for failure instead of successes.

Since: 2.1.6

pexpectFailure :: forall (a :: Type). PExpectFailure a => a -> PExpectingFail a Source #

Mark testable function to expect failing case. Unlike expectFailure from QC, this will *not* abort after encountering one failing. Instead, it will run for all cases and make sure all cases fail. This can accept any Plutarch types.

Since: 2.1.6

haskEquiv' :: forall (e :: Equality) (par :: Partiality) (h :: Type) (p :: S -> Type) (args :: [Type]). (HaskEquiv e par h p args, All Arbitrary args) => h -> (forall s. Term s p) -> Property Source #

Simplified version of haskEquiv. It will use arbitrary instead of asking custom generators.

Since: 2.0.0

haskEquiv :: HaskEquiv e par h p args => h -> TestableTerm p -> NP Gen args -> Property Source #

shrinkPLift :: forall (a :: S -> Type). (PLift a, Arbitrary (PLifted a)) => TestableTerm a -> [TestableTerm a] Source #

This shinker simplifies the underlying Plutarch representation. When shrinking a list, this shinker is always preferable.

Since: 2.0.0

arbitraryPLift :: forall (a :: S -> Type). (PLift a, Arbitrary (PLifted a)) => Gen (TestableTerm a) Source #

This generator uses the Arbitrary instance of a Haskell representation to make a value and lift it into Plutarch.

Since: 2.0.0

data PFun (a :: S -> Type) (b :: S -> Type) where Source #

Constructors

PFun :: (PLift a, PLift b) => [(PLifted a, PLifted b)] -> PLifted b -> TestableTerm (a :--> b) -> PFun a b 

Instances

Instances details
(PLift a, PLift b, Arbitrary (PLifted a), Arbitrary (PLifted b), CoArbitrary (PLifted a), Eq (PLifted a), PEq a) => Arbitrary (PFun a b) Source # 
Instance details

Defined in Plutarch.Test.QuickCheck.Function

Methods

arbitrary :: Gen (PFun a b) Source #

shrink :: PFun a b -> [PFun a b] Source #

(PLift a, PLift b, Show (PLifted a), Show (PLifted b)) => Show (PFun a b) Source # 
Instance details

Defined in Plutarch.Test.QuickCheck.Function

Methods

showsPrec :: Int -> PFun a b -> ShowS Source #

show :: PFun a b -> String Source #

showList :: [PFun a b] -> ShowS Source #

pattern PFn :: forall {a :: S -> Type} {b :: S -> Type}. (PUnsafeLiftDecl a, PUnsafeLiftDecl b) => (forall (s :: S). Term s (a :--> b)) -> PFun a b Source #

data TestableTerm (a :: S -> Type) Source #

TestableTerm is a wrapper for closed Plutarch terms. This abstraction allows Plutarch values to be generated via QuickCheck generators.

Note

The typechecker is picky about how TestableTerms are constructed. Meaning, TestableTerm can throw an error when it's composed.

Since: 2.0.0

Constructors

TestableTerm (forall (s :: S). Term s a) 

Instances

Instances details
PArbitrary p => Arbitrary (TestableTerm p) Source #

Any Plutarch type that implements PArbitrary automatically has an instance of Arbitrary for its TestableTerm. This allows interfacing between QuickCheck and Plutarch.

Note

The default implementation for pshrink does no shrinking. If at all possible, please define a shrinker, as this will make your test results much more useful.

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PCoArbitrary p => CoArbitrary (TestableTerm p) Source # 
Instance details

Defined in Plutarch.Test.QuickCheck.Internal

Methods

coarbitrary :: TestableTerm p -> Gen b -> Gen b Source #

Function (TestableTerm PInteger) Source # 
Instance details

Defined in Plutarch.Test.QuickCheck.Internal

Testable (TestableTerm PBool) Source #

Since: 2.2.1

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

Testable (TestableTerm POpaque) Source #

Since: 2.1.6

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(forall (s :: S). Num (Term s a)) => Num (TestableTerm a) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PShow a => Show (TestableTerm a) Source #

For any Plutarch Type that have a PShow instance, Show is available as well. For those that don't have PShow instances, we have to use forAllShow with custom display function to execute a property check.

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

class PArbitrary (a :: S -> Type) where Source #

PArbitrary is the Plutarch equivalent of the Arbitrary typeclass from QuickCheck. It generates pseudo-random closed term, which can be used to test properties over Plutarch code without having to compile and evaluate.

Default implmentations are given for any Plutarch type that implements PLift a and Arbitrary (PLifted a). This generates a Haskell value and converts it into a Plutarch term using pconstant.

Note

The default implementation for pshrink does no shrinking. If at all possible, please define a shrinker, as this will make your test results much more useful.

Since: 2.0.0

Minimal complete definition

Nothing

Instances

Instances details
PArbitrary PAddress Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PCredential Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PStakingCredential Source #

Since: 2.2.2

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PPubKeyHash Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PDatumHash Source #

Since: 2.2.2

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PScriptHash Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PPOSIXTime Source #

Since: 2.2.2

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PTxId Source #

Since: 2.2.2

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PTxOutRef Source #

Since: 2.2.2

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PCurrencySymbol Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PTokenName Source #

This generates only those PTokenNames that correspond to ASCII strings. This is somewhat limited, but otherwise would require UTF-8 encoding as part of the generator.

Unlike the equivalent Haskell type generator, this instance does not shrink. While somewhat suboptimal, this would require either a lot of lifting or 'lowering' back into Haskell for the shrink.

Since: 2.2.2

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PBool Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PByteString Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PInteger Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PPositive Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PRational Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PString Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary PA Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

PArbitrary PB Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

PArbitrary PC Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck

(PIsData a, PArbitrary a) => PArbitrary (PExtended a) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PIsData a, PArbitrary a) => PArbitrary (PInterval a) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PIsData a, PArbitrary a) => PArbitrary (PLowerBound a) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PIsData a, PArbitrary a) => PArbitrary (PUpperBound a) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PIsData a, PArbitrary a) => PArbitrary (PMaybeData a) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PArbitrary p, PIsData p) => PArbitrary (PAsData p) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PArbitrary a, PIsListLike PBuiltinList a) => PArbitrary (PBuiltinList a) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PArbitrary a, PIsListLike PList a) => PArbitrary (PList a) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary a => PArbitrary (PMaybe a) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary (PUnit :: S -> Type) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PArbitrary a, PArbitrary b, PIsData a, PIsData b) => PArbitrary (PTuple a b) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

PArbitrary (PValue 'Unsorted 'NoGuarantees) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PArbitrary a, PArbitrary b, PIsData a, PIsData b) => PArbitrary (PBuiltinPair (PAsData a) (PAsData b)) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PLift a, PLift b, Arbitrary (PLifted a, PLifted b)) => PArbitrary (PBuiltinPair a b) Source #

Unfortunately, it is impossible to create PBuiltinPair at the Plutarch level without getting into manipulating raw Plutus data. Instead, it can only be created from haskell level value and constanted.

This limitation limites this generator to only accepting Plutarch types that have PLift and Arbitrary (PLifted a).

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PArbitrary a, PArbitrary b) => PArbitrary (PEither a b) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PArbitrary a, PArbitrary b) => PArbitrary (PPair a b) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

(PArbitrary a, PArbitrary b, PIsData a, PIsData b) => PArbitrary (PMap 'Unsorted a b) Source #

Since: 2.0.0

Instance details

Defined in Plutarch.Test.QuickCheck.Internal

pconstantT :: forall {p :: S -> Type} {h :: Type}. (PLift p, PLifted p ~ h) => h -> TestableTerm p Source #

pliftT :: forall {p :: S -> Type} {h :: Type}. (PLift p, PLifted p ~ h) => TestableTerm p -> h Source #

uplcEq :: forall (a :: S -> Type) (b :: S -> Type). TestableTerm a -> TestableTerm b -> Property Source #

Compares evaluated UPLC

Since: 2.0.1

data Equality Source #

Ways an Plutarch terms can be compared. OnPEq uses Plutarch PEq instance to compare give terms. This means two terms with different UPLC representations can be considered equal when PEq instance defines so. OnUPLC uses compiled and evaluated raw UPLC to compare two terms. It is useful comparing Terms that forgot their types-- POpqaue.

Since: 2.1.0

Constructors

OnPEq 
OnPData 
OnBoth 

Instances

Instances details
Show Equality Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

Eq Equality Source # 
Instance details

Defined in Plutarch.Test.QuickCheck

data Partiality Source #

Partiality of the comparison. ByPartial will have some performance disadventages.

Since: 2.1.0

Constructors

ByComplete 
ByPartial 

type PWrapLam (h :: Type) = (PWrapLam' h (IsLam h) (IsLast h), OnlyTestableTerm h) Source #

Constraint for PWrapLam` that will give a better type error message.

Since: 2.1.0

type family PUnLamHask (fin :: S -> Type) (p :: S -> Type) :: Type where ... Source #

Equations

PUnLamHask a a = TestableTerm a 
PUnLamHask fin ((a :--> b) :--> c) = TestableTerm (a :--> b) -> PUnLamHask fin c 
PUnLamHask fin (a :--> b) = TestableTerm a -> PUnLamHask fin b 

type family PLamWrapped (h :: Type) :: Type where ... Source #

Equations

PLamWrapped (TestableTerm (a :--> b) -> c) = PFun a b -> PLamWrapped c 
PLamWrapped (a -> b) = a -> PLamWrapped b 
PLamWrapped a = a 

type FromPFun (end :: S -> Type) (a :: S -> Type) = (PUnLam end a, PWrapLam (PUnLamHask end a)) Source #

Constraint for fromPFun.

Since: 2.2.0

type NotPLam (p :: S -> Type) = IsLam (TestableTerm p) ~ 'False Source #

Ensure given PType('S -> Type') ir not an arrow. This is very useful when using ambiguous type variable.

Since: 2.2.0

shouldCrash :: Script -> Property Source #

Helper for writing property tests at the Haskell level. Given a Script, run it with the largest limits possible: if it crashes, pass; otherwise, fail and report any logs.

Note

Depending on the logging settings the Script was compiled with, you may not get any logs. While we print a warning when this happens, there might have just not been any logs to give you in the first place: there's no way to tell for sure.

Since: 2.1.5

shouldRun :: Script -> Property Source #

Helper for writing property tests at the Haskell level. Given a Script, run it with the largest limits possible: if it runs, pass; otherwise, fail and report the error, as well as any logs.

Note

Depending on the logging settings the Script was compiled with, you may not get any logs. While we print a warning when this happens, there might have just not been any logs to give you in the first place: there's no way to tell for sure.

Since: 2.1.5

Orphan instances