2 {-# LANGUAGE DeriveDataTypeable #-}
3 -- | Exception type like 'ExitCode' but with more information
5 module Test
.Cabal
.TestCode
(
12 import Control
.Exception
(Exception
(..))
13 import Data
.Typeable
(Typeable
)
15 -------------------------------------------------------------------------------
17 -------------------------------------------------------------------------------
23 | TestCodeUnexpectedOk
25 deriving (Eq
, Show, Read, Typeable
)
27 instance Exception TestCode
28 #if MIN_VERSION_base
(4,8,0)
30 displayException
= displayTestCode
33 displayTestCode
:: TestCode
-> String
34 displayTestCode TestCodeOk
= "OK"
35 displayTestCode
(TestCodeSkip msg
) = "SKIP " ++ msg
36 displayTestCode TestCodeKnownFail
= "OK (known failure)"
37 displayTestCode TestCodeUnexpectedOk
= "FAIL (unexpected success)"
38 displayTestCode TestCodeFail
= "FAIL"
40 isTestCodeSkip
:: TestCode
-> Bool
41 isTestCodeSkip
(TestCodeSkip _
) = True
42 isTestCodeSkip _
= False