diff options
Diffstat (limited to 'tests/properties.hs')
-rw-r--r-- | tests/properties.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/properties.hs b/tests/properties.hs index 0d49445..586e94d 100644 --- a/tests/properties.hs +++ b/tests/properties.hs | |||
@@ -32,7 +32,7 @@ prop_EncDec x = case decode (L.toStrict (encode x)) of | |||
32 | data List a = Cons a (List a) | Nil | 32 | data List a = Cons a (List a) | Nil |
33 | deriving (Show, Eq, Generic) | 33 | deriving (Show, Eq, Generic) |
34 | 34 | ||
35 | instance BEncodable a => BEncodable (List a) | 35 | instance BEncode a => BEncode (List a) |
36 | 36 | ||
37 | instance Arbitrary a => Arbitrary (List a) where | 37 | instance Arbitrary a => Arbitrary (List a) where |
38 | arbitrary = frequency | 38 | arbitrary = frequency |
@@ -46,14 +46,14 @@ data FileInfo = FileInfo | |||
46 | , fiMD5Sum :: B.ByteString | 46 | , fiMD5Sum :: B.ByteString |
47 | } deriving (Show, Eq, Generic) | 47 | } deriving (Show, Eq, Generic) |
48 | 48 | ||
49 | instance BEncodable FileInfo | 49 | instance BEncode FileInfo |
50 | 50 | ||
51 | instance Arbitrary FileInfo where | 51 | instance Arbitrary FileInfo where |
52 | arbitrary = FileInfo <$> arbitrary <*> arbitrary <*> arbitrary | 52 | arbitrary = FileInfo <$> arbitrary <*> arbitrary <*> arbitrary |
53 | 53 | ||
54 | data T a = T | 54 | data T a = T |
55 | 55 | ||
56 | prop_bencodable :: Eq a => BEncodable a => T a -> a -> Bool | 56 | prop_bencodable :: Eq a => BEncode a => T a -> a -> Bool |
57 | prop_bencodable _ x = decoded (L.toStrict (encoded x)) == Right x | 57 | prop_bencodable _ x = decoded (L.toStrict (encoded x)) == Right x |
58 | 58 | ||
59 | -- All tests are (encode >>> decode = id) | 59 | -- All tests are (encode >>> decode = id) |