Skip to content

Commit

Permalink
cardano-api:test: Switch from Hedgehog.discover to Tasty.testGroupGen…
Browse files Browse the repository at this point in the history
…erator

Because we need to handle `test_` prefix, too.
  • Loading branch information
cblp committed Sep 14, 2021
1 parent 5f8676f commit eaa3d15
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
2 changes: 2 additions & 0 deletions cardano-api/cardano-api.cabal
Expand Up @@ -207,7 +207,9 @@ test-suite cardano-api-test
, shelley-spec-ledger
, shelley-spec-ledger-test
, tasty
, tasty-hedgehog
, tasty-quickcheck
, tasty-th
, time

other-modules: Test.Cardano.Api.Crypto
Expand Down
12 changes: 8 additions & 4 deletions cardano-api/test/Test/Cardano/Api/Typed/CBOR.hs
Expand Up @@ -5,13 +5,17 @@ module Test.Cardano.Api.Typed.CBOR
( tests
) where

import Hedgehog (Property)
import Test.Tasty (TestTree)
import Test.Tasty.Hedgehog (testProperty)
import Test.Tasty.TH (testGroupGenerator)

import Cardano.Api

import Gen.Cardano.Api.Typed
import Gen.Hedgehog.Roundtrip.CBOR (roundtrip_CBOR)
import Gen.Tasty.Hedgehog.Group (fromGroup)
import Hedgehog (Property, discover)

import Test.Cardano.Api.Typed.Orphans ()
import Test.Tasty (TestTree)

{- HLINT ignore "Use camelCase" -}

Expand Down Expand Up @@ -172,4 +176,4 @@ prop_roundtrip_UpdateProposal_CBOR =
-- -----------------------------------------------------------------------------

tests :: TestTree
tests = fromGroup $$discover
tests = $testGroupGenerator
17 changes: 10 additions & 7 deletions cardano-api/test/Test/Cardano/Api/Typed/JSON.hs
Expand Up @@ -13,15 +13,18 @@ module Test.Cardano.Api.Typed.JSON
) where

import Cardano.Prelude
import Data.Aeson
import Gen.Cardano.Api.Typed
import Gen.Tasty.Hedgehog.Group (fromGroup)
import Hedgehog (Property, discover, forAll, tripping)
import Test.Cardano.Api.Typed.Orphans ()
import Test.Tasty (TestTree)

import Data.Aeson (eitherDecode, encode)
import Hedgehog (Property, forAll, tripping)
import qualified Hedgehog as H
import qualified Hedgehog.Gen as Gen
import Test.Tasty (TestTree)
import Test.Tasty.Hedgehog (testProperty)
import Test.Tasty.TH (testGroupGenerator)

import Gen.Cardano.Api.Typed (genMaybePraosNonce, genProtocolParameters)

import Test.Cardano.Api.Typed.Orphans ()

{- HLINT ignore "Use camelCase" -}

Expand All @@ -38,4 +41,4 @@ prop_roundtrip_protocol_parameters_JSON = H.property $ do
-- -----------------------------------------------------------------------------

tests :: TestTree
tests = fromGroup $$discover
tests = $testGroupGenerator

0 comments on commit eaa3d15

Please sign in to comment.