From a4359d2c67811e71368524d17aeb3809dae657da Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 18 Jan 2017 20:13:45 -0500 Subject: Backported to older bytestring. --- tests/properties.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') 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 @@ {-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE CPP #-} {-# OPTIONS -fno-warn-unused-binds #-} module Main (main) where @@ -55,8 +56,12 @@ instance Arbitrary FileInfo where data T a = T +#if !MIN_VERSION_bytestring(0,10,0) +toStrict bs = BS.concat $ BL.toChunks bs +#endif + prop_bencodable :: Eq a => BEncode a => T a -> a -> Bool -prop_bencodable _ x = decode (BL.toStrict (encode x)) == Right x +prop_bencodable _ x = decode (toStrict (encode x)) == Right x main :: IO () main = hspec $ do -- cgit v1.2.3