ganeti

Safe HaskellNone

Test.Ganeti.Common

Description

Unittests for the Common module.

Synopsis

Documentation

checkOpt Source #

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.

passFailOpt Source #

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] -> Assertion Source #

Helper to test that a given option is accepted OK with quick exit.