on master help sign in
Merge
b818809Bryan O'Sullivan
tests/Instances.hs+7−4
@@ -15,20 +15,23 @@ import Data.Time (ZonedTime(..), LocalTime(..), TimeZone(..),
15 NominalDiffTime)
15 NominalDiffTime)
16import Data.Version
16import Data.Version
17import qualified Data.Text as T
17import qualified Data.Text as T
18−import qualified Data.Map as Map
19import Data.Text (Text)
18import Data.Text (Text)
20import Data.Aeson.Types
19import Data.Aeson.Types
21import Control.Applicative
20import Control.Applicative
22import Functions
21import Functions
23
22
23+#if !MIN_VERSION_QuickCheck(2,8,2)
24+import qualified Data.Map as Map
25+
26+instance (Ord k, Arbitrary k, Arbitrary v) => Arbitrary (Map.Map k v) where
27+ arbitrary = Map.fromList <$> arbitrary
28+#endif
29+
24-- "System" types.
30-- "System" types.
25
31
26instance Arbitrary Text where
32instance Arbitrary Text where
27 arbitrary = T.pack <$> arbitrary
33 arbitrary = T.pack <$> arbitrary
28
34
29−instance (Ord k, Arbitrary k, Arbitrary v) => Arbitrary (Map.Map k v) where
30− arbitrary = Map.fromList <$> arbitrary
31−
32instance Arbitrary TimeOfDay where
35instance Arbitrary TimeOfDay where
33 arbitrary = do
36 arbitrary = do
34 h <- choose (0, 23)
37 h <- choose (0, 23)
tests/UnitTests.hs+5−2
@@ -81,9 +81,12 @@ goodProducer = assertEqual "partial encoding should not explode on undefined"
81 '{' (L.head (encode wibble))
81 '{' (L.head (encode wibble))
82 where
82 where
83 wibble = Wibble {
83 wibble = Wibble {
84− wibbleString = replicate 4030 'a'
84+ wibbleString = replicate k 'a'
85− , wibbleInt = undefined
85+ , wibbleInt = 1
86 }
86 }
87+ k | arch32bit = 4047
88+ | otherwise = 4030
89+ arch32bit = (maxBound :: Int) == 2147483647
87
90
88-- Test decoding various UTC time formats
91-- Test decoding various UTC time formats
89--
92--