Revision 01e52493 htest/Test/Ganeti/HTools/Types.hs

b/htest/Test/Ganeti/HTools/Types.hs
38 38
  , nullIPolicy
39 39
  ) where
40 40

  
41
import Test.QuickCheck
41
import Test.QuickCheck hiding (Result)
42 42

  
43 43
import Control.Applicative
44 44

  
......
46 46
import Test.Ganeti.TestCommon
47 47
import Test.Ganeti.TestHTools
48 48

  
49
import Ganeti.BasicTypes
49 50
import qualified Ganeti.HTools.Types as Types
50 51

  
51 52
-- * Helpers
......
140 141
prop_opToResult :: Types.OpResult Int -> Bool
141 142
prop_opToResult op =
142 143
  case op of
143
    Types.OpFail _ -> Types.isBad r
144
    Types.OpFail _ -> isBad r
144 145
    Types.OpGood v -> case r of
145
                        Types.Bad _ -> False
146
                        Types.Ok v' -> v == v'
146
                        Bad _ -> False
147
                        Ok v' -> v == v'
147 148
  where r = Types.opToResult op
148 149

  
149 150
prop_eitherToResult :: Either String Int -> Bool
150 151
prop_eitherToResult ei =
151 152
  case ei of
152
    Left _ -> Types.isBad r
153
    Left _ -> isBad r
153 154
    Right v -> case r of
154
                 Types.Bad _ -> False
155
                 Types.Ok v' -> v == v'
156
    where r = Types.eitherToResult ei
155
                 Bad _ -> False
156
                 Ok v' -> v == v'
157
    where r = eitherToResult ei
157 158

  
158 159
testSuite "HTools/Types"
159 160
            [ 'prop_AllocPolicy_serialisation

Also available in: Unified diff