chore: fix tests & refactor
This commit is contained in:
parent
1666081fea
commit
af9f96f3f1
@ -50,7 +50,7 @@ import Settings.Mime
|
|||||||
import Data.Monoid (Last(..))
|
import Data.Monoid (Last(..))
|
||||||
import Control.Monad.Trans.RWS (RWST(..))
|
import Control.Monad.Trans.RWS (RWST(..))
|
||||||
import Control.Monad.Trans.State (StateT(..), execStateT, mapStateT)
|
import Control.Monad.Trans.State (StateT(..), execStateT, mapStateT)
|
||||||
import Control.Monad.Trans.Writer (execWriter, Writer)
|
import Control.Monad.Trans.Writer (execWriter, execWriterT, Writer)
|
||||||
import Control.Monad.RWS.Class (MonadWriter(..), MonadState(..), modify)
|
import Control.Monad.RWS.Class (MonadWriter(..), MonadState(..), modify)
|
||||||
import Control.Monad.Fail
|
import Control.Monad.Fail
|
||||||
import Control.Monad.Base
|
import Control.Monad.Base
|
||||||
@ -124,8 +124,6 @@ import Language.Haskell.TH (nameBase)
|
|||||||
|
|
||||||
import Network.Mail.Mime.Instances()
|
import Network.Mail.Mime.Instances()
|
||||||
|
|
||||||
import Control.Monad.Trans.Writer (execWriterT)
|
|
||||||
|
|
||||||
|
|
||||||
makeLenses_ ''Address
|
makeLenses_ ''Address
|
||||||
makeLenses_ ''Mail
|
makeLenses_ ''Mail
|
||||||
|
|||||||
@ -14,7 +14,7 @@ instance Arbitrary MailContext where
|
|||||||
arbitrary = genericArbitrary
|
arbitrary = genericArbitrary
|
||||||
shrink = genericShrink
|
shrink = genericShrink
|
||||||
|
|
||||||
instance Arbitrary VerpMode where
|
instance Arbitrary Address where
|
||||||
arbitrary = genericArbitrary
|
arbitrary = genericArbitrary
|
||||||
shrink = genericShrink
|
shrink = genericShrink
|
||||||
|
|
||||||
@ -25,5 +25,3 @@ spec = do
|
|||||||
[ eqLaws, ordLaws, showReadLaws, monoidLaws ]
|
[ eqLaws, ordLaws, showReadLaws, monoidLaws ]
|
||||||
lawsCheckHspec (Proxy @MailContext)
|
lawsCheckHspec (Proxy @MailContext)
|
||||||
[ eqLaws, ordLaws, showReadLaws, jsonLaws, hashableLaws ]
|
[ eqLaws, ordLaws, showReadLaws, jsonLaws, hashableLaws ]
|
||||||
lawsCheckHspec (Proxy @VerpMode)
|
|
||||||
[ eqLaws, showReadLaws, jsonLaws ]
|
|
||||||
|
|||||||
@ -5,9 +5,10 @@ module ModelSpec where
|
|||||||
|
|
||||||
import TestImport
|
import TestImport
|
||||||
|
|
||||||
import Settings (getTimeLocale')
|
import Settings (getTimeLocale', VerpMode(..))
|
||||||
|
|
||||||
import Model.TypesSpec ()
|
import Model.TypesSpec ()
|
||||||
|
import MailSpec ()
|
||||||
|
|
||||||
import qualified Data.CaseInsensitive as CI
|
import qualified Data.CaseInsensitive as CI
|
||||||
import qualified Data.ByteString.Char8 as CBS
|
import qualified Data.ByteString.Char8 as CBS
|
||||||
@ -203,6 +204,11 @@ instance {-# OVERLAPS #-} (HasCryptoID ns ct pt (ReaderT CryptoIDKey Catch), Arb
|
|||||||
where
|
where
|
||||||
tmpKey = unsafePerformIO genKey
|
tmpKey = unsafePerformIO genKey
|
||||||
|
|
||||||
|
instance Arbitrary VerpMode where
|
||||||
|
arbitrary = genericArbitrary
|
||||||
|
shrink = genericShrink
|
||||||
|
|
||||||
|
|
||||||
spec :: Spec
|
spec :: Spec
|
||||||
spec = do
|
spec = do
|
||||||
parallel $ do
|
parallel $ do
|
||||||
@ -214,3 +220,5 @@ spec = do
|
|||||||
[ eqLaws ]
|
[ eqLaws ]
|
||||||
lawsCheckHspec (Proxy @Term)
|
lawsCheckHspec (Proxy @Term)
|
||||||
[ eqLaws, jsonLaws ]
|
[ eqLaws, jsonLaws ]
|
||||||
|
lawsCheckHspec (Proxy @VerpMode)
|
||||||
|
[ eqLaws, showReadLaws, jsonLaws ]
|
||||||
|
|||||||
Reference in New Issue
Block a user