Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- serializeSpec :: forall a. (Show a, Eq a, Typeable a, GenValid a, Serialize a) => Spec
- serializeSpecOnArbitrary :: forall a. (Show a, Eq a, Typeable a, Arbitrary a, Serialize a) => Spec
- serializeSpecOnGen :: forall a. (Show a, Eq a, Typeable a, Serialize a) => Gen a -> String -> (a -> [a]) -> Spec
- neverFailsToEncodeOnGen :: (Show a, Serialize a) => Gen a -> (a -> [a]) -> Property
- encodeAndDecodeAreInversesOnGen :: (Show a, Eq a, Serialize a) => Gen a -> (a -> [a]) -> Property
Documentation
serializeSpec :: forall a. (Show a, Eq a, Typeable a, GenValid a, Serialize a) => Spec Source #
Standard test spec for properties of Serialize
-related functions for valid values
Example usage:
serializeSpec @Int
serializeSpecOnArbitrary :: forall a. (Show a, Eq a, Typeable a, Arbitrary a, Serialize a) => Spec Source #
Standard test spec for properties of Serialize
-related functions for arbitrary values
Example usage:
serializeSpecOnArbitrary @Int
serializeSpecOnGen :: forall a. (Show a, Eq a, Typeable a, Serialize a) => Gen a -> String -> (a -> [a]) -> Spec Source #
Standard test spec for properties of Serialize
-related functions for a given generator (and a name for that generator).
Example usage:
serializeSpecOnGen (genListOf $ pure 'a') "sequence of 'a's"
neverFailsToEncodeOnGen :: (Show a, Serialize a) => Gen a -> (a -> [a]) -> Property Source #
neverFailsToEncodeOnGen @Bool arbitrary shrink
neverFailsToEncodeOnGen @Bool genValid shrinkValid
neverFailsToEncodeOnGen @Bool genValid shrinkValid
neverFailsToEncodeOnGen @Int arbitrary shrink
neverFailsToEncodeOnGen @Int genValid shrinkValid
neverFailsToEncodeOnGen @Int genValid shrinkValid
encodeAndDecodeAreInversesOnGen :: (Show a, Eq a, Serialize a) => Gen a -> (a -> [a]) -> Property Source #
encodeAndDecodeAreInversesOnGen @Bool arbitrary shrink
encodeAndDecodeAreInversesOnGen @Bool genValid shrinkValid
encodeAndDecodeAreInversesOnGen @Bool genValid shrinkValid
encodeAndDecodeAreInversesOnGen @Int arbitrary shrink
encodeAndDecodeAreInversesOnGen @Int genValid shrinkValid
encodeAndDecodeAreInversesOnGen @Int genValid shrinkValid