{-# LANGUAGE TemplateHaskell #-}
module Test.Cardano.Chain.Common.Attributes (
tests,
) where
import Cardano.Prelude
import Hedgehog (assert, forAll, property)
import Hedgehog.Internal.Show (mkValue)
import Test.Cardano.Chain.Common.Gen (genAddrAttributes, genAttributes)
import Test.Cardano.Prelude
import Test.Options (TSGroup, TSProperty, withTestsTS)
ts_prop_show_AddressAttributes_is_haskell :: TSProperty
ts_prop_show_AddressAttributes_is_haskell :: TSProperty
ts_prop_show_AddressAttributes_is_haskell =
TestLimit -> Property -> TSProperty
withTestsTS TestLimit
1000 (Property -> TSProperty)
-> (PropertyT IO () -> Property) -> PropertyT IO () -> TSProperty
forall b c a. (b -> c) -> (a -> b) -> a -> c
forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. HasCallStack => PropertyT IO () -> Property
PropertyT IO () -> Property
property (PropertyT IO () -> TSProperty) -> PropertyT IO () -> TSProperty
forall a b. (a -> b) -> a -> b
$ do
Attributes AddrAttributes
attr <- Gen (Attributes AddrAttributes)
-> PropertyT IO (Attributes AddrAttributes)
forall (m :: * -> *) a.
(Monad m, Show a, HasCallStack) =>
Gen a -> PropertyT m a
forAll (Gen (Attributes AddrAttributes)
-> PropertyT IO (Attributes AddrAttributes))
-> Gen (Attributes AddrAttributes)
-> PropertyT IO (Attributes AddrAttributes)
forall a b. (a -> b) -> a -> b
$ Gen AddrAttributes -> Gen (Attributes AddrAttributes)
forall a. Gen a -> Gen (Attributes a)
genAttributes Gen AddrAttributes
genAddrAttributes
Bool -> PropertyT IO ()
forall (m :: * -> *). (MonadTest m, HasCallStack) => Bool -> m ()
assert (Bool -> PropertyT IO ()) -> Bool -> PropertyT IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Value -> Bool
forall a. Maybe a -> Bool
isJust (Maybe Value -> Bool) -> Maybe Value -> Bool
forall a b. (a -> b) -> a -> b
$ Attributes AddrAttributes -> Maybe Value
forall a. Show a => a -> Maybe Value
mkValue Attributes AddrAttributes
attr
tests :: TSGroup
tests :: TSGroup
tests = $$discoverPropArg