Created
August 3, 2014 13:17
-
-
Save jml/25166ff19edc724a2964 to your computer and use it in GitHub Desktop.
Two very similar quickcheck properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Transformation a = (TodoFile -> a -> (TodoFile, [TodoEvent])) | |
| -- XXX: If there were something that was like 'map f' but when given a | |
| -- non-list would lift to a list and return a singleton, that would make this | |
| -- more generic. | |
| prop_emptyUnchanged_multiple :: Transformation [Int] -> Property | |
| prop_emptyUnchanged_multiple transformation = | |
| property $ \items -> transformation emptyFile items `shouldBe` (emptyFile, map NoSuchTask (nub items)) | |
| prop_emptyUnchanged_single :: Transformation Int -> Property | |
| prop_emptyUnchanged_single transformation = | |
| property $ \item -> transformation emptyFile item `shouldBe` (emptyFile, [NoSuchTask item]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment