This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
fradrive-old/test/Utils/DateTimeSpec.hs
2019-07-03 11:59:02 +02:00

25 lines
681 B
Haskell

module Utils.DateTimeSpec where
import TestImport
import Utils.DateTime
instance Arbitrary DateTimeFormat where
arbitrary = DateTimeFormat <$> arbitrary
shrink = genericShrink
instance Arbitrary SelDateTimeFormat where
arbitrary = genericArbitrary
shrink = genericShrink
instance CoArbitrary SelDateTimeFormat where
coarbitrary = genericCoarbitrary
spec :: Spec
spec = do
parallel $ do
lawsCheckHspec (Proxy @DateTimeFormat)
[ eqLaws, ordLaws, showReadLaws, jsonLaws, persistFieldLaws, hashableLaws ]
lawsCheckHspec (Proxy @SelDateTimeFormat)
[ eqLaws, ordLaws, showReadLaws, boundedEnumLaws, finiteLaws, hashableLaws, jsonLaws, jsonKeyLaws ]