Revision a7ea861a htools/Ganeti/HTools/QC.hs
b/htools/Ganeti/HTools/QC.hs | ||
---|---|---|
1478 | 1478 |
Types.Ok v -> failTest $ "Expected failure, got " ++ show v |
1479 | 1479 |
_ -> property True |
1480 | 1480 |
|
1481 |
-- | Test parseYesNo. |
|
1482 |
prop_CLI_parseYesNo def testval val = |
|
1483 |
forAll (elements [val, "yes", "no"]) $ \actual_val -> |
|
1484 |
if testval |
|
1485 |
then CLI.parseYesNo def Nothing ==? Types.Ok def |
|
1486 |
else let result = CLI.parseYesNo def (Just actual_val) |
|
1487 |
in if actual_val `elem` ["yes", "no"] |
|
1488 |
then result ==? Types.Ok (actual_val == "yes") |
|
1489 |
else property $ Types.isBad result |
|
1490 |
|
|
1481 | 1491 |
testSuite "CLI" |
1482 | 1492 |
[ 'prop_CLI_parseISpec |
1483 | 1493 |
, 'prop_CLI_parseISpecFail |
1494 |
, 'prop_CLI_parseYesNo |
|
1484 | 1495 |
] |
Also available in: Unified diff