packages feed

log4hs-0.2.0.0: test/Logging/TypesSpec.hs

{-# LANGUAGE RecordWildCards    #-}
{-# LANGUAGE StandaloneDeriving #-}

module Logging.TypesSpec ( spec ) where

import           Data.String           (fromString)
import           Test.Hspec
import           Test.Hspec.QuickCheck
import           Test.QuickCheck

import           Logging.Types
import           Logging.Utils

spec :: Spec
spec = levelSpec


levelSpec :: Spec
levelSpec = describe "Level" $ modifyMaxSize (const 1000) $ do
  prop "read and show" $ \x -> (read . show) (Level x) == (Level x)
  prop "overload string" $ \x -> fromString (show (Level x)) == (Level x)