summaryrefslogtreecommitdiff
path: root/tests/properties.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/properties.hs')
-rw-r--r--tests/properties.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/properties.hs b/tests/properties.hs
index 876b954..478dd8c 100644
--- a/tests/properties.hs
+++ b/tests/properties.hs
@@ -1,4 +1,5 @@
1{-# LANGUAGE DeriveGeneric #-} 1{-# LANGUAGE DeriveGeneric #-}
2{-# LANGUAGE CPP #-}
2{-# OPTIONS -fno-warn-unused-binds #-} 3{-# OPTIONS -fno-warn-unused-binds #-}
3module Main (main) where 4module Main (main) where
4 5
@@ -55,8 +56,12 @@ instance Arbitrary FileInfo where
55 56
56data T a = T 57data T a = T
57 58
59#if !MIN_VERSION_bytestring(0,10,0)
60toStrict bs = BS.concat $ BL.toChunks bs
61#endif
62
58prop_bencodable :: Eq a => BEncode a => T a -> a -> Bool 63prop_bencodable :: Eq a => BEncode a => T a -> a -> Bool
59prop_bencodable _ x = decode (BL.toStrict (encode x)) == Right x 64prop_bencodable _ x = decode (toStrict (encode x)) == Right x
60 65
61main :: IO () 66main :: IO ()
62main = hspec $ do 67main = hspec $ do