cardano-ledger-test-9.9.9.9: Testing harness, tests and benchmarks for Shelley style cardano ledgers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Constrained.Tests

Synopsis

Documentation

data GenEnv era Source #

Constructors

GenEnv 

Fields

  • gOrderOrderInfo
     
  • gEnvEnv era
     
  • gSolvedMap (Name era) Depth

    Which variables in the environment have we "solved", i.e. generated a constraint that allows solving them. Also track the "depth" of the variable in the dependency order (depth = 1 + depth of dependencies).

Instances

Instances details
Show (GenEnv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Tests

Methods

showsPrecIntGenEnv era → ShowS Source #

showGenEnv era → String Source #

showList ∷ [GenEnv era] → ShowS Source #

type Depth = Int Source #

addVarV era t → t → GenEnv era → GenEnv era Source #

markSolvedHashSet (Name era) → DepthGenEnv era → GenEnv era Source #

addSolvedVarV era t → t → DepthGenEnv era → GenEnv era Source #

depthOfNameGenEnv era → Name era → Depth Source #

depthOfGenEnv era → Term era t → Depth Source #

depthOfSumGenEnv era → Sum era c → Depth Source #

genLiteral ∷ ∀ era t. Era era ⇒ GenEnv era → Rep era t → Gen t Source #

envVarsOfTypeEra era ⇒ Env era → Rep era t → [(V era t, t)] Source #

data VarSpec Source #

Constructors

VarTerm Depth

Must contain a variable (either unsolved, or solved at least the given depth). Requiring a minimum depth let's us avoid introducing cycles in already solved variables.

KnownTerm

Can only use solved variables

Instances

Instances details
Show VarSpec Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Tests

Eq VarSpec Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Tests

Methods

(==)VarSpecVarSpecBool Source #

(/=)VarSpecVarSpecBool Source #

genTermEra era ⇒ GenEnv era → Rep era t → VarSpecGen (Term era t, GenEnv era) Source #

genTerm' ∷ ∀ era t. Era era ⇒ GenEnv era → Rep era t → (t → Bool) → Gen t → VarSpecGen (Term era t, GenEnv era) Source #

genMapLiteralWithDomEra era ⇒ GenEnv era → Rep era v → Set k → Gen (Map k v) Source #

genMapLiteralWithRng ∷ (Era era, Ord k) ⇒ GenEnv era → Rep era k → Set v → Gen (Map k v) Source #

data TypeInEra era where Source #

Constructors

TypeInEra ∷ (Show t, Ord t) ⇒ Rep era t → TypeInEra era 

errPred ∷ [String] → Pred era Source #

Unsatisfiable constraint returned if we fail during constraint generation.

genFromOrdCond ∷ (Arbitrary c, Adds c) ⇒ OrdCondBool → c → Gen c Source #

genPredicate ∷ ∀ era. Era era ⇒ GenEnv era → Gen (Pred era, GenEnv era) Source #

genPredsEra era ⇒ GenEnv era → Gen ([Pred era], GenEnv era) Source #

withEqRep era t → (Eq t ⇒ a) → Maybe a Source #

shrinkPreds ∷ ∀ era. Era era ⇒ ([Pred era], GenEnv era) → [([Pred era], GenEnv era)] Source #

ensureRightTestable prop ⇒ Either [String] a → (a → prop) → Property Source #

ifRightTestable prop ⇒ Either [String] a → (a → prop) → Property Source #

ensureTypedTestable prop ⇒ Typed a → (a → prop) → Property Source #

ifTypedTestable prop ⇒ Typed a → (a → prop) → Property Source #

showValRep era t → t → String Source #

showTermTerm era t → String Source #

showEnvEnv era → String Source #

checkPredicates ∷ [Pred era] → Env era → Property Source #

prop_soundnessOrderInfoProperty Source #

Generate a set of satisfiable constraints and check that we can generate a solution and that it actually satisfies the constraints.

prop_soundness'Bool → [String] → OrderInfoProperty Source #

If argument is True, fail property if constraints cannot be solved. Otherwise discard unsolved constraints.

prop_shrinkingOrderInfoProperty Source #

Check that shrinking is sound, i.e. that all shrink steps preserves constraint satisfaction.

Orphan instances