diff options
Diffstat (limited to 'tests/properties.hs')
-rw-r--r-- | tests/properties.hs | 7 |
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 #-} |
3 | module Main (main) where | 4 | module Main (main) where |
4 | 5 | ||
@@ -55,8 +56,12 @@ instance Arbitrary FileInfo where | |||
55 | 56 | ||
56 | data T a = T | 57 | data T a = T |
57 | 58 | ||
59 | #if !MIN_VERSION_bytestring(0,10,0) | ||
60 | toStrict bs = BS.concat $ BL.toChunks bs | ||
61 | #endif | ||
62 | |||
58 | prop_bencodable :: Eq a => BEncode a => T a -> a -> Bool | 63 | prop_bencodable :: Eq a => BEncode a => T a -> a -> Bool |
59 | prop_bencodable _ x = decode (BL.toStrict (encode x)) == Right x | 64 | prop_bencodable _ x = decode (toStrict (encode x)) == Right x |
60 | 65 | ||
61 | main :: IO () | 66 | main :: IO () |
62 | main = hspec $ do | 67 | main = hspec $ do |