on master help sign in
Tests: remove some gratuitous use of CPP
commit5105752638ef2ebf274c2be0bc2ede4ee5ccb9bd authorBryan O'Sullivan <bos@serpentine.com> dateWed 19 Feb 2014, 13:20 (13 years ago) parent96ea9f2
1 file changed+3−7
tests/Tests/Properties.hs+3−7
tests/Tests/Properties.hs+3−7
@@ -1,6 +1,6 @@
11-- | General quicktest properties for the text library
22--
3−{-# LANGUAGE BangPatterns, CPP, FlexibleInstances, OverloadedStrings,
3+{-# LANGUAGE BangPatterns, FlexibleInstances, OverloadedStrings,
44 ScopedTypeVariables, TypeSynonymInstances #-}
55{-# OPTIONS_GHC -fno-enable-rewrite-rules #-}
66{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
@@ -15,7 +15,6 @@ import Text.Show.Functions ()
1515
1616import Control.Applicative ((<$>), (<*>))
1717import Control.Arrow ((***), second)
18−import Control.Exception (catch)
1918import Data.Bits ((.&.))
2019import Data.Char (chr, isDigit, isHexDigit, isLower, isSpace, isUpper, ord)
2120import Data.Int (Int8, Int16, Int32, Int64)
@@ -32,6 +31,7 @@ import Data.Word (Word, Word8, Word16, Word32, Word64)
3231import Numeric (showHex)
3332import Test.Framework (Test, testGroup)
3433import Test.Framework.Providers.QuickCheck2 (testProperty)
34+import qualified Control.Exception as Exception
3535import qualified Data.Bits as Bits (shiftL, shiftR)
3636import qualified Data.ByteString as B
3737import qualified Data.ByteString.Lazy as BL
@@ -56,11 +56,7 @@ import Tests.QuickCheckUtils
5656import Tests.Utils
5757import qualified Tests.SlowFunctions as Slow
5858
59−#if MIN_VERSION_base(4,6,0)
6059import Prelude hiding (replicate)
61−#else
62−import Prelude hiding (catch, replicate)
63−#endif
6460
6561t_pack_unpack = (T.unpack . T.pack) `eq` id
6662tl_pack_unpack = (TL.unpack . TL.pack) `eq` id
@@ -130,7 +126,7 @@ t_utf8_err bad de = do
130126 onErr <- genDecodeErr de
131127 monadicIO $ do
132128 l <- run $ let len = T.length (E.decodeUtf8With onErr bs)
133− in (len `seq` return (Right len)) `catch`
129+ in (len `seq` return (Right len)) `Exception.catch`
134130 (\(e::UnicodeException) -> return (Left e))
135131 assert $ case l of
136132 Left err -> length (show err) >= 0