diff options
author | Julien Tanguy <julien.tanguy@jhome.fr> | 2015-05-16 02:12:14 +0200 |
---|---|---|
committer | Julien Tanguy <julien.tanguy@jhome.fr> | 2015-05-16 02:12:14 +0200 |
commit | 90695615c54b5939d7286e777cb1b19a221616b9 (patch) | |
tree | 0994f0d528149264fce9c8caa183fea4c6b653c0 /test/Crypto/Macaroon/Instances.hs | |
parent | 857f2f3ba8ba2de9ab65ea3c66eafb718fe4e1a6 (diff) | |
download | hmacaroons-90695615c54b5939d7286e777cb1b19a221616b9.tar.gz hmacaroons-90695615c54b5939d7286e777cb1b19a221616b9.tar.zst hmacaroons-90695615c54b5939d7286e777cb1b19a221616b9.zip |
Fix caveat verification
QuickCheck properties > HUnit tests
Diffstat (limited to 'test/Crypto/Macaroon/Instances.hs')
-rw-r--r-- | test/Crypto/Macaroon/Instances.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Crypto/Macaroon/Instances.hs b/test/Crypto/Macaroon/Instances.hs index 17044a0..c82bbd3 100644 --- a/test/Crypto/Macaroon/Instances.hs +++ b/test/Crypto/Macaroon/Instances.hs | |||
@@ -26,9 +26,16 @@ import Crypto.Macaroon | |||
26 | 26 | ||
27 | -- | Adjust the size parameter, by transforming it with the given | 27 | -- | Adjust the size parameter, by transforming it with the given |
28 | -- function. | 28 | -- function. |
29 | -- Copied over from QuickCheck 2.8 | ||
29 | scale :: (Int -> Int) -> Gen a -> Gen a | 30 | scale :: (Int -> Int) -> Gen a -> Gen a |
30 | scale f g = sized (\n -> resize (f n) g) | 31 | scale f g = sized (\n -> resize (f n) g) |
31 | 32 | ||
33 | |||
34 | -- | Generates a random subsequence of the given list. | ||
35 | -- Copied over from QuickCheck 2.8 | ||
36 | sublistOf :: [a] -> Gen [a] | ||
37 | sublistOf = filterM (\_ -> choose (False, True)) | ||
38 | |||
32 | newtype Url = Url { unUrl :: BS.ByteString } deriving (Show) | 39 | newtype Url = Url { unUrl :: BS.ByteString } deriving (Show) |
33 | 40 | ||
34 | instance Arbitrary Url where | 41 | instance Arbitrary Url where |