Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Soupstraw committed Apr 25, 2024
1 parent 7248a8a commit f2ffe1b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ agdaCompatibleProposal prop =

limitTreeSize :: IsConwayUniv fn => Term fn ProposalTree -> Pred fn
limitTreeSize proptree = match proptree $ \_ trees ->
forAll trees $ \tree -> genHint (Just 3, 1) tree
forAll trees $ genHint (Just 3, 1)

instance
( NFData (SpecRep (ConwayGovPredFailure Conway))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module Test.Cardano.Ledger.Conformance.ExecSpecRule.Core (
import Cardano.Ledger.BaseTypes (ShelleyBase)
import Cardano.Ledger.Core (EraRule)
import qualified Constrained as CV2
import Constrained.Base (Specification (..), shrinkWithSpec)
import Constrained.Base (Specification (..), shrinkWithSpec, simplifySpec)
import Control.State.Transition.Extended (STS (..))
import Data.Bifunctor (Bifunctor (..))
import Data.Bitraversable (bimapM)
Expand Down Expand Up @@ -201,11 +201,11 @@ conformsToImpl ::
) =>
Property
conformsToImpl =
let envSpec = environmentSpec @fn @rule @era
let envSpec = simplifySpec $ environmentSpec @fn @rule @era
in forAllShrinkShow (CV2.genFromSpec_ envSpec) (shrinkWithSpec envSpec) showExpr $ \env ->
let stSpec = stateSpec @fn @rule @era env
let stSpec = simplifySpec $ stateSpec @fn @rule @era env
in forAllShrinkShow (CV2.genFromSpec_ stSpec) (shrinkWithSpec stSpec) showExpr $ \st ->
let sigSpec = signalSpec @fn @rule @era env st
let sigSpec = simplifySpec $ signalSpec @fn @rule @era env st
in forAllShrinkShow (CV2.genFromSpec_ sigSpec) (shrinkWithSpec sigSpec) showExpr $ \sig ->
do
(implResTest, agdaResTest) <- runConformance @rule @fn @era env st sig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ import Test.Cardano.Ledger.Conway.ImpTest ()
import Test.Cardano.Ledger.Imp.Common

spec :: Spec
spec = describe "Conway conformance tests" . modifyMaxSuccess (const 3) $ do
xprop "UTXO" $ conformsToImpl @"UTXO" @ConwayFn @Conway
prop "GOV" $ conformsToImpl @"GOV" @ConwayFn @Conway
describe "Generators" $ do
let
genEnv = CV2.genFromSpec_ (environmentSpec @ConwayFn @"GOV" @Conway)
genSt = CV2.genFromSpec_ . stateSpec @ConwayFn @"GOV" @Conway =<< genEnv
genSig = do
env <- genEnv
st <- genSt
CV2.genFromSpec_ (signalSpec @ConwayFn @"GOV" @Conway env st)
genEnv `generatesWithin` 3_000_000
genSt `generatesWithin` 40_000_000
genSig `generatesWithin` 60_000_000
spec = describe "Conway conformance tests"
. modifyMaxSuccess (const 100)
. modifyMaxSize (const 5)
$ do
xprop "UTXO" $ conformsToImpl @"UTXO" @ConwayFn @Conway
prop "GOV" $ conformsToImpl @"GOV" @ConwayFn @Conway
describe "Generators" $ do
let
genEnv = CV2.genFromSpec_ (environmentSpec @ConwayFn @"GOV" @Conway)
genSt = CV2.genFromSpec_ . stateSpec @ConwayFn @"GOV" @Conway =<< genEnv
genSig = do
env <- genEnv
st <- genSt
CV2.genFromSpec_ (signalSpec @ConwayFn @"GOV" @Conway env st)
genEnv `generatesWithin` 3_000_000
genSt `generatesWithin` 40_000_000
genSig `generatesWithin` 60_000_000

0 comments on commit f2ffe1b

Please sign in to comment.