Copyright | (c) Fumiaki Kinoshita 2019 |
---|---|
License | BSD3 |
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Maintainer : Fumiaki Kinoshita fumiexcel@gmail.com
A test framework that allows you to test all related Serialise instances with automatically-generated test cases
Synopsis
- class Typeable a => TestGen a where
- genTestCases :: [a]
- inheritedTests :: Proxy a -> Map TypeRep [Test]
- printTests :: forall a. (TestGen a, Serialise a, Show a) => IO ()
- class TestGen a => Tested a where
- testCase :: (Show a, Eq a, Serialise a) => Schema -> ByteString -> a -> Test
- allTests :: forall a. (TestGen a, Tested a) => Map TypeRep [Test]
- mergeTests :: Map TypeRep [Test] -> Test
Generating tests
class Typeable a => TestGen a where Source #
A class to provide test values and gather tests for its components. It is recommended to use the generic default methods.
Nothing
genTestCases :: [a] Source #
A list of values that can be used as test cases. It should contain at least one value as long as there is a non-bottom value in the type.
inheritedTests :: Proxy a -> Map TypeRep [Test] Source #
Inherited set of test cases for each type it involves.
genTestCases :: (Generic a, GTestGen (Rep a)) => [a] Source #
A list of values that can be used as test cases. It should contain at least one value as long as there is a non-bottom value in the type.
inheritedTests :: GTestGen (Rep a) => Proxy a -> Map TypeRep [Test] Source #
Inherited set of test cases for each type it involves.
Instances
printTests :: forall a. (TestGen a, Serialise a, Show a) => IO () Source #
Generate test cases and print them to the standard output.
Test cases
class TestGen a => Tested a where Source #
Types with concrete test cases.
/"Doubt is useful, it keeps faith a living thing. After all, you cannot know the strength of your faith until it has been tested."/
Instances
Tested Bool Source # | |
Defined in Data.Winery.Test | |
Tested Char Source # | |
Defined in Data.Winery.Test | |
Tested Double Source # | |
Defined in Data.Winery.Test | |
Tested Int Source # | |
Defined in Data.Winery.Test | |
Tested () Source # | |
Defined in Data.Winery.Test | |
Tested a => Tested [a] Source # | |
Defined in Data.Winery.Test | |
Tested a => Tested (Identity a) Source # | |
Defined in Data.Winery.Test | |
Tested a => Tested (Seq a) Source # | |
Defined in Data.Winery.Test | |
(Unbox a, Tested a) => Tested (Vector a) Source # | |
Defined in Data.Winery.Test | |
Tested a => Tested (Vector a) Source # | |
Defined in Data.Winery.Test | |
(Tested a, Tested b) => Tested (Either a b) Source # | |
Defined in Data.Winery.Test | |
(Tested a, Tested b) => Tested (a, b) Source # | |
Defined in Data.Winery.Test | |
(Hashable k, Tested k, Tested a) => Tested (HashMap k a) Source # | |
Defined in Data.Winery.Test |
Construct a test case.