on master help sign in
Merge
commitb8188094721c6ec2a015b8ffb2c2007631d49cf8 authorBryan O'Sullivan <bos@serpentine.com> dateThu 21 Jan 2016, 22:27 (11 years ago) parentd5e867da35b557
2 files changed+12−6
tests/Instances.hs+7−4 tests/UnitTests.hs+5−2
tests/Instances.hs+7−4
@@ -15,20 +15,23 @@ import Data.Time (ZonedTime(..), LocalTime(..), TimeZone(..),
1515 NominalDiffTime)
1616import Data.Version
1717import qualified Data.Text as T
18−import qualified Data.Map as Map
1918import Data.Text (Text)
2019import Data.Aeson.Types
2120import Control.Applicative
2221import Functions
2322
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+
2430-- "System" types.
2531
2632instance Arbitrary Text where
2733 arbitrary = T.pack <$> arbitrary
2834
29−instance (Ord k, Arbitrary k, Arbitrary v) => Arbitrary (Map.Map k v) where
30− arbitrary = Map.fromList <$> arbitrary
31−
3235instance Arbitrary TimeOfDay where
3336 arbitrary = do
3437 h <- choose (0, 23)
tests/UnitTests.hs+5−2
@@ -81,9 +81,12 @@ goodProducer = assertEqual "partial encoding should not explode on undefined"
8181 '{' (L.head (encode wibble))
8282 where
8383 wibble = Wibble {
84− wibbleString = replicate 4030 'a'
85− , wibbleInt = undefined
84+ wibbleString = replicate k 'a'
85+ , wibbleInt = 1
8686 }
87+ k | arch32bit = 4047
88+ | otherwise = 4030
89+ arch32bit = (maxBound :: Int) == 2147483647
8790
8891-- Test decoding various UTC time formats
8992--