summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-09-28 05:59:08 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-09-28 05:59:08 +0400
commitf8d3081122e35c96e291c61ad53c5da6dcda1fb2 (patch)
treee7f21f2639f38592c789d0574a6206eb17b34c3d /tests
parent51fecc396f8c7ccd3f91125d5fbac040051915c6 (diff)
Rename BEncoding to BEncode
Diffstat (limited to 'tests')
-rw-r--r--tests/properties.hs6
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
32data List a = Cons a (List a) | Nil 32data List a = Cons a (List a) | Nil
33 deriving (Show, Eq, Generic) 33 deriving (Show, Eq, Generic)
34 34
35instance BEncodable a => BEncodable (List a) 35instance BEncode a => BEncode (List a)
36 36
37instance Arbitrary a => Arbitrary (List a) where 37instance 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
49instance BEncodable FileInfo 49instance BEncode FileInfo
50 50
51instance Arbitrary FileInfo where 51instance Arbitrary FileInfo where
52 arbitrary = FileInfo <$> arbitrary <*> arbitrary <*> arbitrary 52 arbitrary = FileInfo <$> arbitrary <*> arbitrary <*> arbitrary
53 53
54data T a = T 54data T a = T
55 55
56prop_bencodable :: Eq a => BEncodable a => T a -> a -> Bool 56prop_bencodable :: Eq a => BEncode a => T a -> a -> Bool
57prop_bencodable _ x = decoded (L.toStrict (encoded x)) == Right x 57prop_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)