Safe Haskell | None |
---|
Unittests for our template-haskell generated code.
Synopsis
- data TestObj = TestObj {}
- loadTestObj :: JSValue -> Result TestObj
- saveTestObj :: TestObj -> JSValue
- prop_OptFields :: TestObj -> Property
- prop_TestObj_serialization :: TestObj -> Property
- prop_TestObj_deserialisationFail :: Property
- data UnitObj = UnitObj {
- loadUnitObj :: JSValue -> Result UnitObj
- saveUnitObj :: UnitObj -> JSValue
- prop_UnitObj_serialization :: UnitObj -> Property
- prop_UnitObj_deserialisationFail :: Property
- data FilledTestParams = FilledTestParams {}
- data PartialTestParams = PartialTestParams {}
- allTestParamFields :: [String]
- loadPartialTestParams :: JSValue -> Result PartialTestParams
- savePartialTestParams :: PartialTestParams -> JSValue
- loadFilledTestParams :: JSValue -> Result FilledTestParams
- saveFilledTestParams :: FilledTestParams -> JSValue
- prop_fillWithPartialParams :: Property
- prop_fillPartialLaw1 :: FilledTestParams -> PartialTestParams -> Property
- prop_toParams :: Property
- prop_fillPartialLaw2 :: FilledTestParams -> FilledTestParams -> Property
- prop_fillPartialLaw3 :: FilledTestParams -> Property
- prop_fillPartialMonoidLaw1 :: FilledTestParams -> Property
- prop_fillPartialMonoidLaw2 :: FilledTestParams -> PartialTestParams -> PartialTestParams -> Property
- testTHH :: Test
Custom types
Type used to test optional field implementation. Equivalent to
data TestObj = TestObj { tobjA :: Maybe Int, tobjB :: Maybe Int
}
.
loadTestObj :: JSValue -> Result TestObj Source #
saveTestObj :: TestObj -> JSValue Source #
prop_OptFields :: TestObj -> Property Source #
Tests that serialising an (arbitrary) TestObj
instance is
correct: fully optional fields are represented in the resulting
dictionary only when non-null, optional-but-required fields are
always represented (with either null or an actual value).
prop_TestObj_serialization :: TestObj -> Property Source #
Test serialization of TestObj.
prop_TestObj_deserialisationFail :: Property Source #
Test that all superfluous keys will fail to parse.
loadUnitObj :: JSValue -> Result UnitObj Source #
saveUnitObj :: UnitObj -> JSValue Source #
prop_UnitObj_serialization :: UnitObj -> Property Source #
Test serialization of UnitObj.
prop_UnitObj_deserialisationFail :: Property Source #
Test that all superfluous keys will fail to parse.
allTestParamFields :: [String] Source #
loadPartialTestParams :: JSValue -> Result PartialTestParams Source #
savePartialTestParams :: PartialTestParams -> JSValue Source #
loadFilledTestParams :: JSValue -> Result FilledTestParams Source #
saveFilledTestParams :: FilledTestParams -> JSValue Source #
prop_fillWithPartialParams :: Property Source #
Tests that filling partial parameters works as expected.
prop_fillPartialLaw1 :: FilledTestParams -> PartialTestParams -> Property Source #
Tests that filling partial parameters satisfies the law.
prop_toParams :: Property Source #
Tests that filling partial parameters works as expected.
prop_fillPartialLaw2 :: FilledTestParams -> FilledTestParams -> Property Source #
Tests that filling partial parameters satisfies the law.
prop_fillPartialLaw3 :: FilledTestParams -> Property Source #
Tests that filling partial parameters satisfies the law.
prop_fillPartialMonoidLaw1 :: FilledTestParams -> Property Source #
Tests that the monoid action laws are satisfied.
prop_fillPartialMonoidLaw2 :: FilledTestParams -> PartialTestParams -> PartialTestParams -> Property Source #
Tests that the monoid action laws are satisfied.