ganeti

Safe HaskellNone

Test.Ganeti.Common

Description

Unittests for the Common module.

Synopsis

Documentation

checkOptSource

Arguments

:: 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.

passFailOptSource

Arguments

:: 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