Safe Haskell | None |
---|
Unittests for the Common
module.
- checkOpt :: StandardOptions b => (a -> Maybe String) -> b -> (String -> c) -> (String -> d -> d -> c) -> (a -> d) -> (a, GenericOptType b, b -> d) -> c
- passFailOpt :: StandardOptions b => b -> (String -> c) -> c -> (GenericOptType b, String, String) -> c
- checkEarlyExit :: StandardOptions a => a -> String -> [GenericOptType a] -> [ArgCompletion] -> Assertion
- prop_parse_yes_no :: Bool -> Bool -> String -> Property
- case_formatCommands :: Assertion
- testCommon :: Test
Documentation
:: StandardOptions b | |
=> (a -> Maybe String) | Converts the value into a cmdline form |
-> b | The default options |
-> (String -> c) | Fail test function |
-> (String -> d -> d -> c) | Check for equality function |
-> (a -> d) | Transforms the value to a compare val |
-> (a, GenericOptType b, b -> d) | Triple of value, the option, function to extract the set value from the options |
-> c |
Helper to check for correct parsing of an option.
:: StandardOptions b | |
=> b | The default options |
-> (String -> c) | Fail test function |
-> c | Pass function |
-> (GenericOptType b, String, String) | The list of enabled options, fail value and pass value |
-> c |
Helper to check for correct and incorrect parsing of an option.
checkEarlyExit :: StandardOptions a => a -> String -> [GenericOptType a] -> [ArgCompletion] -> AssertionSource
Helper to test that a given option is accepted OK with quick exit.
prop_parse_yes_no :: Bool -> Bool -> String -> PropertySource
case_formatCommands :: AssertionSource
testCommon :: TestSource