Revision 2e0bb81d htest/Test/Ganeti/HTools/CLI.hs

b/htest/Test/Ganeti/HTools/CLI.hs
56 56
  let str = intercalate "," $ map show (values::[Int])
57 57
  in case CLI.parseISpecString descr str of
58 58
       Types.Ok v -> failTest $ "Expected failure, got " ++ show v
59
       _ -> property True
59
       _ -> passTest
60 60

  
61 61
-- | Test parseYesNo.
62 62
prop_parseYesNo :: Bool -> Bool -> [Char] -> Property
......
99 99
checkEarlyExit :: String -> [CLI.OptType] -> String -> Property
100 100
checkEarlyExit name options param =
101 101
  case CLI.parseOptsInner [param] name options of
102
    Left (code, _) -> if code == 0
103
                          then property True
104
                          else failTest $ "Program " ++ name ++
105
                                 " returns invalid code " ++ show code ++
106
                                 " for option " ++ param
102
    Left (code, _) ->
103
      printTestCase ("Program " ++ name ++
104
                     " returns invalid code " ++ show code ++
105
                     " for option " ++ param) (code == 0)
107 106
    _ -> failTest $ "Program " ++ name ++ " doesn't consider option " ++
108 107
         param ++ " as early exit one"
109 108

  

Also available in: Unified diff