1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
{-# LANGUAGE CPP #-}
{-|
Module: Spec.Control.ExceptionSpec
Copyright: (C) 2014-2017 Ryan Scott
License: BSD-style (see the file LICENSE)
Maintainer: Ryan Scott
Stability: Provisional
Portability: GHC
@hspec@ tests for data types in the "Control.Exception" module.
-}
module Spec.Control.ExceptionSpec (main, spec) where
import Control.Exception
#if MIN_VERSION_base(4,11,0)
import Control.Exception.Base (FixIOException)
#endif
import Data.Proxy.Compat (Proxy(..))
import Instances.Control.Exception ()
import Spec.Utils (matchesTextShowSpec)
import Test.Hspec (Spec, describe, hspec, parallel)
main :: IO ()
main = hspec spec
spec :: Spec
spec = parallel . describe "TextShow.Control.Exception" $ do
describe "SomeException" $
matchesTextShowSpec (Proxy :: Proxy SomeException)
describe "IOException" $
matchesTextShowSpec (Proxy :: Proxy IOException)
describe "ArithException" $
matchesTextShowSpec (Proxy :: Proxy ArithException)
describe "ArrayException" $
matchesTextShowSpec (Proxy :: Proxy ArrayException)
describe "AssertionFailed" $
matchesTextShowSpec (Proxy :: Proxy AssertionFailed)
describe "SomeAsyncException" $
matchesTextShowSpec (Proxy :: Proxy SomeAsyncException)
describe "AsyncException" $
matchesTextShowSpec (Proxy :: Proxy AsyncException)
describe "NonTermination" $
matchesTextShowSpec (Proxy :: Proxy NonTermination)
describe "NestedAtomically" $
matchesTextShowSpec (Proxy :: Proxy NestedAtomically)
describe "BlockedIndefinitelyOnMVar" $
matchesTextShowSpec (Proxy :: Proxy BlockedIndefinitelyOnMVar)
describe "BlockedIndefinitelyOnSTM" $
matchesTextShowSpec (Proxy :: Proxy BlockedIndefinitelyOnSTM)
#if MIN_VERSION_base(4,8,0)
describe "AllocationLimitExceeded" $
matchesTextShowSpec (Proxy :: Proxy AllocationLimitExceeded)
#endif
#if MIN_VERSION_base(4,9,0)
describe "TypeError" $
matchesTextShowSpec (Proxy :: Proxy TypeError)
#endif
#if MIN_VERSION_base(4,10,0)
describe "CompactionFailed" $
matchesTextShowSpec (Proxy :: Proxy CompactionFailed)
#endif
#if MIN_VERSION_base(4,11,0)
describe "FixIOException" $
matchesTextShowSpec (Proxy :: Proxy FixIOException)
#endif
describe "Deadlock" $
matchesTextShowSpec (Proxy :: Proxy Deadlock)
describe "NoMethodError" $
matchesTextShowSpec (Proxy :: Proxy NoMethodError)
describe "PatternMatchFail" $
matchesTextShowSpec (Proxy :: Proxy PatternMatchFail)
describe "RecConError" $
matchesTextShowSpec (Proxy :: Proxy RecConError)
describe "RecSelError" $
matchesTextShowSpec (Proxy :: Proxy RecSelError)
describe "RecUpdError" $
matchesTextShowSpec (Proxy :: Proxy RecUpdError)
describe "ErrorCall" $
matchesTextShowSpec (Proxy :: Proxy ErrorCall)
describe "MaskingState" $
matchesTextShowSpec (Proxy :: Proxy MaskingState)
|