Permalink
Browse files

Testing in progress

  • Loading branch information...
erikd committed Feb 11, 2019
1 parent e4f4d86 commit dc7319d5c96bef156eb481410822ac5276ef356f
@@ -420,7 +420,7 @@ genHeaderAndParams pm = do
-- drop all all leaders of headers from previous epochs.
thisEpochStartIndex = fromIntegral dummyEpochSlots *
fromIntegral (header ^. Core.epochIndexL)
thisHeadersEpoch = drop thisEpochStartIndex leaders
thisHeadersEpoch = drop (min 0 thisEpochStartIndex) leaders
-- A helper function. Given integers 'x' and 'y', it chooses a
-- random integer in the interval [x, y]
betweenXAndY :: Random a => a -> a -> a
@@ -7,6 +7,7 @@

module Test.Pos.Chain.Block.BlockSpec
( spec
, spec2
) where

import Universum
@@ -68,6 +69,14 @@ spec = describe "Block properties" $ modifyMaxSuccess (min 20) $ do
emptyHeaderChain l pm =
isVerSuccess $ Block.verifyHeaders pm Nothing l

spec2 :: Spec
spec2 = describe "BlockgenHeaderAndParams" $ modifyMaxSuccess (min 20) $ do
prop "vhpLeaders is not Nothing" $ \ pm -> forAll (hapParams <$> genHeaderAndParams pm) $ \ params ->
isNothing (Block.vhpLeaders params) === False

prop "Successfully verifies a correct main block header" validateGoodMainHeader


-- | Both of the following tests are boilerplate - they use `mkGenericHeader` to create
-- headers and then compare these with manually built headers.
--
@@ -14,11 +14,14 @@ import qualified Test.Pos.Chain.Txp.Json
import qualified Test.Pos.Chain.Update.Bi
import qualified Test.Pos.Chain.Update.Json
import Test.Pos.Util.Tripping (runTests)
import Test.Pos.Chain.Block.BlockSpec (spec2)

main :: IO ()
main = do
hspec spec
runTests
hspec spec2
when False $ do
hspec spec
runTests
[ Test.Pos.Chain.Block.Bi.tests
, Test.Pos.Chain.Delegation.Bi.tests
, Test.Pos.Chain.Genesis.Json.tests
@@ -242,7 +242,7 @@ ghc-options:
cardano-sl-auxx: -Wall -Werror -Wcompat -fwarn-redundant-constraints
cardano-sl-binary: -Wall -Werror -Wcompat -fwarn-redundant-constraints
cardano-sl-binary-test: -Wall -Werror -Wcompat -fwarn-redundant-constraints
cardano-sl-chain: -Wall -Werror -Wcompat -fwarn-redundant-constraints
cardano-sl-chain: -fwarn-redundant-constraints
cardano-sl-chain-test: -Wall -Werror -Wcompat -fwarn-redundant-constraints
cardano-sl-client: -Wall -Werror -Wcompat -fwarn-redundant-constraints
cardano-sl-core: -Wall -Werror -Wcompat -fwarn-redundant-constraints

0 comments on commit dc7319d

Please sign in to comment.