aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/Crypto/Macaroon/Instances.hs
diff options
context:
space:
mode:
authorJulien Tanguy <julien.tanguy@jhome.fr>2015-05-16 02:12:14 +0200
committerJulien Tanguy <julien.tanguy@jhome.fr>2015-05-16 02:12:14 +0200
commit90695615c54b5939d7286e777cb1b19a221616b9 (patch)
tree0994f0d528149264fce9c8caa183fea4c6b653c0 /test/Crypto/Macaroon/Instances.hs
parent857f2f3ba8ba2de9ab65ea3c66eafb718fe4e1a6 (diff)
downloadhmacaroons-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.hs7
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
29scale :: (Int -> Int) -> Gen a -> Gen a 30scale :: (Int -> Int) -> Gen a -> Gen a
30scale f g = sized (\n -> resize (f n) g) 31scale 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
36sublistOf :: [a] -> Gen [a]
37sublistOf = filterM (\_ -> choose (False, True))
38
32newtype Url = Url { unUrl :: BS.ByteString } deriving (Show) 39newtype Url = Url { unUrl :: BS.ByteString } deriving (Show)
33 40
34instance Arbitrary Url where 41instance Arbitrary Url where