@@ -46,27 +46,30 @@ import Text.Printf (printf)
4646-- | Contains all necessary data to run a 'GenesisTest'.
4747-- It is defined to reify the testing infrastructure for
4848-- the conformance `testgen` executable.
49- data ConformanceTest blk prop = ConformanceTest
49+ data ConformanceTest blk = ConformanceTest
5050 { ctGenerator :: Gen (GenesisTestFull blk )
5151 -- ^ The test generator.
5252 , ctSchedulerConfig :: SchedulerConfig
5353 -- ^ Scheduler configuration parameters.
5454 , ctShrinker :: (GenesisTestFull blk -> StateView blk -> [GenesisTestFull blk ])
5555 -- ^ A shrinker with a
56- , ctProperty :: GenesisTestFull blk -> StateView blk -> prop
56+ , ctProperty :: GenesisTestFull blk -> StateView blk -> Property
5757 -- ^ The property to test.
5858 -- , ctDesiredPasses :: Int
5959 -- ^ Sets the expected number of test runs to check the property.
6060 }
6161
6262mkConformanceTest ::
63+ (Testable prop ) =>
6364 -- Int ->
6465 Gen (GenesisTestFull blk ) ->
6566 SchedulerConfig ->
6667 (GenesisTestFull blk -> StateView blk -> [GenesisTestFull blk ]) ->
6768 (GenesisTestFull blk -> StateView blk -> prop ) ->
68- ConformanceTest blk prop
69- mkConformanceTest ctGenerator ctSchedulerConfig ctShrinker ctProperty = ConformanceTest {.. }
69+ ConformanceTest blk
70+ mkConformanceTest ctGenerator ctSchedulerConfig ctShrinker mkProperty =
71+ let ctProperty = fmap property . mkProperty
72+ in ConformanceTest {.. }
7073
7174-- | Like 'runSimStrictShutdown' but fail when the main thread terminates if
7275-- there are other threads still running or blocked. If one is trying to follow
@@ -112,10 +115,9 @@ runGenesisTest' schedulerConfig genesisTest makeProperty =
112115 runGenesisTest schedulerConfig genesisTest
113116
114117runConformanceTest :: forall blk prop .
115- ( Testable prop
116- , blk ~ TestBlock
118+ ( blk ~ TestBlock
117119 ) =>
118- ConformanceTest blk prop -> Property
120+ ConformanceTest blk -> Property
119121runConformanceTest ConformanceTest {.. } =
120122 forAllGenRunShrinkCheck ctGenerator runner shrinker' $ \ genesisTest result ->
121123 let cls = classifiers genesisTest
0 commit comments