genvalidity-property-0.2.0.1: Standard properties for functions on `Validity` types

Safe HaskellNone
LanguageHaskell2010

Test.Validity.Functions

Description

Validity tests involving functions

Synopsis

Documentation

producesValidsOnGen :: forall a b. (Show a, Show b, Validity b) => (a -> b) -> Gen a -> (a -> [a]) -> Property Source #

The function produces valid output when the input is generated as specified by the given generator.

producesValidsOnValids :: (Show a, Show b, GenValid a, Validity b) => (a -> b) -> Property Source #

The function produces valid output when the input is generated by genValid

producesValid :: (Show a, Show b, GenUnchecked a, Validity b) => (a -> b) -> Property Source #

The function produces valid output when the input is generated by genUnchecked

producesValidsOnArbitrary :: (Show a, Show b, Arbitrary a, Validity b) => (a -> b) -> Property Source #

The function produces valid output when the input is generated by arbitrary

producesValidsOnGens2 :: (Show a, Show b, Show c, Validity c) => (a -> b -> c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property Source #

producesValidsOnValids2 :: (Show a, Show b, Show c, GenValid a, GenValid b, Validity c) => (a -> b -> c) -> Property Source #

producesValid2 :: (Show a, Show b, Show c, GenUnchecked a, GenUnchecked b, Validity c) => (a -> b -> c) -> Property Source #

producesValidsOnGens3 :: (Show a, Show b, Show c, Show d, Validity d) => (a -> b -> c -> d) -> Gen (a, b, c) -> ((a, b, c) -> [(a, b, c)]) -> Property Source #

producesValidsOnValids3 :: (Show a, Show b, Show c, Show d, GenValid a, GenValid b, GenValid c, Validity d) => (a -> b -> c -> d) -> Property Source #

producesValid3 :: (Show a, Show b, Show c, Show d, GenUnchecked a, GenUnchecked b, GenUnchecked c, Validity d) => (a -> b -> c -> d) -> Property Source #

producesValidsOnArbitrary3 :: (Show a, Show b, Show c, Show d, Arbitrary a, Arbitrary b, Arbitrary c, Validity d) => (a -> b -> c -> d) -> Property Source #

succeedsOnGen :: (Show a, Show b, Show (f b), CanFail f) => (a -> f b) -> Gen a -> (a -> [a]) -> Property Source #

The function succeeds if the input is generated by the given generator

succeedsOnValid :: (Show a, Show b, Show (f b), GenValid a, CanFail f) => (a -> f b) -> Property Source #

The function succeeds if the input is generated by genValid

succeeds :: (Show a, Show b, Show (f b), GenUnchecked a, CanFail f) => (a -> f b) -> Property Source #

The function succeeds if the input is generated by genUnchecked

succeedsOnArbitrary :: (Show a, Show b, Show (f b), Arbitrary a, CanFail f) => (a -> f b) -> Property Source #

The function succeeds if the input is generated by arbitrary

succeedsOnGens2 :: (Show a, Show b, Show c, Show (f c), CanFail f) => (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property Source #

succeedsOnValids2 :: (Show a, Show b, Show c, Show (f c), GenValid a, GenValid b, CanFail f) => (a -> b -> f c) -> Property Source #

succeeds2 :: (Show a, Show b, Show c, Show (f c), GenUnchecked a, GenUnchecked b, CanFail f) => (a -> b -> f c) -> Property Source #

succeedsOnArbitrary2 :: (Show a, Show b, Show c, Show (f c), Arbitrary a, Arbitrary b, CanFail f) => (a -> b -> f c) -> Property Source #

failsOnGen :: (Show a, Show b, Show (f b), CanFail f) => (a -> f b) -> Gen a -> (a -> [a]) -> Property Source #

The function fails if the input is generated by the given generator

failsOnInvalid :: (Show a, Show b, Show (f b), GenInvalid a, CanFail f) => (a -> f b) -> Property Source #

The function fails if the input is generated by genInvalid

failsOnGens2 :: (Show a, Show b, Show c, Show (f c), CanFail f) => (a -> b -> f c) -> Gen a -> (a -> [a]) -> Gen b -> (b -> [b]) -> Property Source #

failsOnInvalid2 :: (Show a, Show b, Show c, Show (f c), GenInvalid a, GenInvalid b, CanFail f) => (a -> b -> f c) -> Property Source #

validIfSucceedsOnGen :: (Show a, Show b, Show (f b), Validity b, CanFail f) => (a -> f b) -> Gen a -> (a -> [a]) -> Property Source #

The function produces output that satisfies isValid if it is given input that is generated by the given generator.

validIfSucceedsOnValid :: (Show a, Show b, Show (f b), GenValid a, Validity b, CanFail f) => (a -> f b) -> Property Source #

The function produces output that satisfies isValid if it is given input that is generated by arbitrary.

validIfSucceedsOnArbitrary :: (Show a, Show b, Show (f b), Arbitrary a, Validity b, CanFail f) => (a -> f b) -> Property Source #

The function produces output that satisfies isValid if it is given input that is generated by arbitrary.

validIfSucceeds :: (Show a, Show b, Show (f b), GenUnchecked a, Validity b, CanFail f) => (a -> f b) -> Property Source #

The function produces output that satisfies isValid if it is given input that is generated by genUnchecked.

validIfSucceedsOnGens2 :: (Show a, Show b, Show c, Show (f c), Validity c, CanFail f) => (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property Source #

validIfSucceedsOnValids2 :: (Show a, Show b, Show c, Show (f c), GenValid a, GenValid b, Validity c, CanFail f) => (a -> b -> f c) -> Property Source #

validIfSucceeds2 :: (Show a, Show b, Show c, Show (f c), GenUnchecked a, GenUnchecked b, Validity c, CanFail f) => (a -> b -> f c) -> Property Source #

validIfSucceedsOnArbitrary2 :: (Show a, Show b, Show c, Show (f c), Arbitrary a, Arbitrary b, Validity c, CanFail f) => (a -> b -> f c) -> Property Source #

validIfSucceedsOnGens3 :: (Show a, Show b, Show c, Show d, Show (f d), Validity d, CanFail f) => (a -> b -> c -> f d) -> Gen (a, b, c) -> ((a, b, c) -> [(a, b, c)]) -> Property Source #

validIfSucceedsOnValids3 :: (Show a, Show b, Show c, Show d, Show (f d), GenValid a, GenValid b, GenValid c, Validity d, CanFail f) => (a -> b -> c -> f d) -> Property Source #

validIfSucceeds3 :: (Show a, Show b, Show c, Show d, Show (f d), GenUnchecked a, GenUnchecked b, GenUnchecked c, Validity d, CanFail f) => (a -> b -> c -> f d) -> Property Source #

validIfSucceedsOnArbitrary3 :: (Show a, Show b, Show c, Show d, Show (f d), Arbitrary a, Arbitrary b, Arbitrary c, Validity d, CanFail f) => (a -> b -> c -> f d) -> Property Source #

equivalentOnGen :: (Show a, Eq a, Show b, Eq b) => (a -> b) -> (a -> b) -> Gen a -> (a -> [a]) -> Property Source #

equivalentOnValid :: (Show a, Eq a, GenValid a, Show b, Eq b) => (a -> b) -> (a -> b) -> Property Source #

equivalent :: (Show a, Eq a, GenUnchecked a, Show b, Eq b) => (a -> b) -> (a -> b) -> Property Source #

equivalentOnArbitrary :: (Show a, Eq a, Arbitrary a, Show b, Eq b) => (a -> b) -> (a -> b) -> Property Source #

equivalentOnArbitrary ((* 2) . (+ 1)) ((+ 2) . (* 2) :: Int -> Int)

equivalentOnGens2 :: (Show a, Show b, Show c, Eq c) => (a -> b -> c) -> (a -> b -> c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property Source #

equivalentOnValids2 :: (Show a, GenValid a, Show b, GenValid b, Show c, Eq c) => (a -> b -> c) -> (a -> b -> c) -> Property Source #

equivalent2 :: (Show a, GenUnchecked a, Show b, GenUnchecked b, Show c, Eq c) => (a -> b -> c) -> (a -> b -> c) -> Property Source #

equivalentOnArbitrary2 :: (Show a, Arbitrary a, Show b, Arbitrary b, Show c, Eq c) => (a -> b -> c) -> (a -> b -> c) -> Property Source #

equivalentOnArbitrary2 (+) ((+) :: Int -> Int -> Int)

equivalentWhenFirstSucceedsOnGen :: (Show a, Eq a, Show b, Eq b, CanFail f) => (a -> f b) -> (a -> b) -> Gen a -> (a -> [a]) -> Property Source #

equivalentWhenFirstSucceedsOnValid :: (Show a, Eq a, GenValid a, Show b, Eq b, CanFail f) => (a -> f b) -> (a -> b) -> Property Source #

equivalentWhenFirstSucceeds :: (Show a, Eq a, GenUnchecked a, Show b, Eq b, CanFail f) => (a -> f b) -> (a -> b) -> Property Source #

equivalentWhenFirstSucceedsOnArbitrary :: (Show a, Eq a, Arbitrary a, Show b, Eq b, CanFail f) => (a -> f b) -> (a -> b) -> Property Source #

equivalentWhenFirstSucceedsOnGens2 :: (Show a, Eq a, Show b, Eq b, Show c, Eq c, CanFail f) => (a -> b -> f c) -> (a -> b -> c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property Source #

equivalentWhenFirstSucceedsOnValids2 :: (Show a, Eq a, GenValid a, Show b, Eq b, GenValid b, Show c, Eq c, CanFail f) => (a -> b -> f c) -> (a -> b -> c) -> Property Source #

equivalentWhenFirstSucceeds2 :: (Show a, Eq a, GenUnchecked a, Show b, Eq b, GenUnchecked b, Show c, Eq c, CanFail f) => (a -> b -> f c) -> (a -> b -> c) -> Property Source #

equivalentWhenFirstSucceedsOnArbitrary2 :: (Show a, Eq a, Arbitrary a, Show b, Eq b, Arbitrary b, Show c, Eq c, CanFail f) => (a -> b -> f c) -> (a -> b -> c) -> Property Source #

equivalentWhenSecondSucceedsOnGen :: (Show a, Eq a, Show b, Eq b, CanFail f) => (a -> b) -> (a -> f b) -> Gen a -> (a -> [a]) -> Property Source #

equivalentWhenSecondSucceedsOnValid :: (Show a, Eq a, GenValid a, Show b, Eq b, CanFail f) => (a -> b) -> (a -> f b) -> Property Source #

equivalentWhenSecondSucceeds :: (Show a, Eq a, GenUnchecked a, Show b, Eq b, CanFail f) => (a -> b) -> (a -> f b) -> Property Source #

equivalentWhenSecondSucceedsOnArbitrary :: (Show a, Eq a, Arbitrary a, Show b, Eq b, CanFail f) => (a -> b) -> (a -> f b) -> Property Source #

equivalentWhenSecondSucceedsOnGens2 :: (Show a, Eq a, Show b, Eq b, Show c, Eq c, CanFail f) => (a -> b -> c) -> (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property Source #

equivalentWhenSecondSucceedsOnValids2 :: (Show a, Eq a, GenValid a, Show b, Eq b, GenValid b, Show c, Eq c, CanFail f) => (a -> b -> c) -> (a -> b -> f c) -> Property Source #

equivalentWhenSecondSucceeds2 :: (Show a, Eq a, GenUnchecked a, Show b, Eq b, GenUnchecked b, Show c, Eq c, CanFail f) => (a -> b -> c) -> (a -> b -> f c) -> Property Source #

equivalentWhenSecondSucceedsOnArbitrary2 :: (Show a, Eq a, Arbitrary a, Show b, Eq b, Arbitrary b, Show c, Eq c, CanFail f) => (a -> b -> c) -> (a -> b -> f c) -> Property Source #

equivalentWhenSucceedOnGen :: (Show a, Eq a, Show b, Eq b, CanFail f) => (a -> f b) -> (a -> f b) -> Gen a -> (a -> [a]) -> Property Source #

equivalentWhenSucceedOnValid :: (Show a, Eq a, GenValid a, Show b, Eq b, CanFail f) => (a -> f b) -> (a -> f b) -> Property Source #

equivalentWhenSucceed :: (Show a, Eq a, GenUnchecked a, Show b, Eq b, CanFail f) => (a -> f b) -> (a -> f b) -> Property Source #

equivalentWhenSucceedOnArbitrary :: (Show a, Eq a, Arbitrary a, Show b, Eq b, CanFail f) => (a -> f b) -> (a -> f b) -> Property Source #

equivalentWhenSucceedOnGens2 :: (Show a, Eq a, Show b, Eq b, Show c, Eq c, CanFail f) => (a -> b -> f c) -> (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property Source #

equivalentWhenSucceedOnValids2 :: (Show a, Eq a, GenValid a, Show b, Eq b, GenValid b, Show c, Eq c, CanFail f) => (a -> b -> f c) -> (a -> b -> f c) -> Property Source #

equivalentWhenSucceed2 :: (Show a, Eq a, GenUnchecked a, Show b, Eq b, GenUnchecked b, Show c, Eq c, CanFail f) => (a -> b -> f c) -> (a -> b -> f c) -> Property Source #

equivalentWhenSucceedOnArbitrary2 :: (Show a, Eq a, Arbitrary a, Show b, Eq b, Arbitrary b, Show c, Eq c, CanFail f) => (a -> b -> f c) -> (a -> b -> f c) -> Property Source #

equivalentOnGens3 :: (Show a, Show b, Show c, Show d, Eq d) => (a -> b -> c -> d) -> (a -> b -> c -> d) -> Gen (a, b, c) -> ((a, b, c) -> [(a, b, c)]) -> Property Source #

equivalentOnValids3 :: (Show a, GenValid a, Show b, GenValid b, Show c, GenValid c, Show d, Eq d) => (a -> b -> c -> d) -> (a -> b -> c -> d) -> Property Source #

equivalent3 :: (Show a, GenUnchecked a, Show b, GenUnchecked b, Show c, GenUnchecked c, Show d, Eq d) => (a -> b -> c -> d) -> (a -> b -> c -> d) -> Property Source #

equivalentOnArbitrary3 :: (Show a, Arbitrary a, Show b, Arbitrary b, Show c, Arbitrary c, Show d, Eq d) => (a -> b -> c -> d) -> (a -> b -> c -> d) -> Property Source #

inverseFunctionsOnGen :: (Show a, Eq a) => (a -> b) -> (b -> a) -> Gen a -> (a -> [a]) -> Property Source #

inverseFunctionsOnValid :: (Show a, Eq a, GenValid a) => (a -> b) -> (b -> a) -> Property Source #

inverseFunctions :: (Show a, Eq a, GenUnchecked a) => (a -> b) -> (b -> a) -> Property Source #

inverseFunctionsOnArbitrary :: (Show a, Eq a, Arbitrary a) => (a -> b) -> (b -> a) -> Property Source #

id is its own inverse function for every type: prop> inverseFunctionsOnArbitrary id (id :: Int -> Int)

inverseFunctionsIfFirstSucceedsOnGen :: (Show a, Eq a, CanFail f) => (a -> f b) -> (b -> a) -> Gen a -> (a -> [a]) -> Property Source #

inverseFunctionsIfFirstSucceedsOnValid :: (Show a, Eq a, GenValid a, CanFail f) => (a -> f b) -> (b -> a) -> Property Source #

inverseFunctionsIfFirstSucceeds :: (Show a, Eq a, GenUnchecked a, CanFail f) => (a -> f b) -> (b -> a) -> Property Source #

inverseFunctionsIfSecondSucceedsOnGen :: (Show a, Eq a, CanFail f) => (a -> b) -> (b -> f a) -> Gen a -> (a -> [a]) -> Property Source #

inverseFunctionsIfSecondSucceedsOnValid :: (Show a, Eq a, GenValid a, CanFail f) => (a -> b) -> (b -> f a) -> Property Source #

inverseFunctionsIfSecondSucceeds :: (Show a, Eq a, GenUnchecked a, CanFail f) => (a -> b) -> (b -> f a) -> Property Source #

inverseFunctionsIfSucceedOnGen :: (Show a, Eq a, CanFail f, CanFail g) => (a -> f b) -> (b -> g a) -> Gen a -> (a -> [a]) -> Property Source #

inverseFunctionsIfSucceedOnValid :: (Show a, Eq a, GenValid a, CanFail f, CanFail g) => (a -> f b) -> (b -> g a) -> Property Source #

inverseFunctionsIfSucceed :: (Show a, Eq a, GenUnchecked a, CanFail f, CanFail g) => (a -> f b) -> (b -> g a) -> Property Source #

inverseFunctionsIfSucceedOnArbitrary :: (Show a, Eq a, Arbitrary a, CanFail f, CanFail g) => (a -> f b) -> (b -> g a) -> Property Source #

idempotentOnGen :: (Show a, Eq a) => (a -> a) -> Gen a -> (a -> [a]) -> Property Source #

idempotentOnValid :: (Show a, Eq a, GenValid a) => (a -> a) -> Property Source #

idempotent :: (Show a, Eq a, GenUnchecked a) => (a -> a) -> Property Source #

idempotentOnArbitrary :: (Show a, Eq a, Arbitrary a) => (a -> a) -> Property Source #

id is idempotent for any type:

idempotentOnArbitrary (id :: Int -> Int)

const, given any input, is idempotent for any type as well:

\int -> idempotentOnArbitrary (const int :: Int -> Int)