summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-01-18 20:13:45 -0500
committerjoe <joe@jerkface.net>2017-01-18 20:13:45 -0500
commita4359d2c67811e71368524d17aeb3809dae657da (patch)
treee3e240de09b6b446a6e8ee38429aa23ef1ef396d /tests
parent27957be6c747a9ce4a98273e0099f15dd1a6f163 (diff)
Backported to older bytestring.
Diffstat (limited to 'tests')
-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