Safe HaskellNone



Unittests for ganeti-htools.



genFilter :: Gen (Filter FilterField) Source #

Custom Filter generator (top-level), which enforces a (sane) limit on the depth of the generated filters.

genFilter' :: Int -> Gen (Filter FilterField) Source #

Custom generator for filters that correctly halves the state of the generators at each recursive step, per the QuickCheck documentation, in order not to run out of memory.

genJSValue :: Gen JSValue Source #

Generates an arbitrary JSValue. We do this via a function a not via arbitrary instance since that would require us to define an arbitrary for JSValue, which can be recursive, entering the usual problems with that; so we only generate the base types, not the recursive ones, and not JSNull, which we can't use in a RSNormal ResultEntry.

genResultEntry :: Gen ResultEntry Source #

Generates a ResultEntry value.

prop_filter_serialisation :: Property Source #

Tests that serialisation/deserialisation of filters is idempotent.

prop_filterregex_instances :: FilterRegex -> Property Source #

Tests that filter regexes are serialised correctly.

prop_fieldtype_serialisation :: FieldType -> Property Source #

Tests FieldType serialisation.

prop_fielddef_serialisation :: FieldDefinition -> Property Source #

Tests FieldDef serialisation.

prop_resultentry_serialisation :: Property Source #

Tests ResultEntry serialisation. Needed especially as this is done manually, and not via buildObject (different serialisation format).

prop_fieldsresult_serialisation :: Property Source #

Tests FieldDef serialisation. We use a made-up maximum limit of 20 for the generator, since otherwise the lists become too long and we don't care so much about list length but rather structure.

prop_itemtype_serialisation :: ItemType -> Property Source #

Tests ItemType serialisation.

case_filterParsing :: Assertion Source #

Tests basic cases of filter parsing, including legacy ones.

Orphan instances

Arbitrary ResultStatus # 
Instance details

Arbitrary FieldType # 
Instance details

Arbitrary QueryTypeOp # 
Instance details

Arbitrary QueryTypeLuxi # 
Instance details

Arbitrary FilterRegex # 
Instance details

Arbitrary ItemType # 
Instance details

Arbitrary FieldDefinition # 
Instance details

Arbitrary QueryFieldsResult # 
Instance details

Arbitrary (Filter FilterField) # 
Instance details