@@ -1,24 +1,14 @@
1−{-# LANGUAGE CPP, DeriveDataTypeable, OverloadedStrings, RecordWildCards,
1+{-# LANGUAGE OverloadedStrings, RecordWildCards, ScopedTypeVariables #-}
2− ScopedTypeVariables, StandaloneDeriving, TemplateHaskell #-}
3−{-# OPTIONS_GHC -fno-warn-orphans #-}
6−{-# LANGUAGE DeriveGeneric, StandaloneDeriving #-}
10−import Control.Applicative
11import Data.Aeson.Encode
3import Data.Aeson.Encode
12import Data.Aeson.Parser (value)
4import Data.Aeson.Parser (value)
13import Data.Aeson.Types
5import Data.Aeson.Types
15import Data.Attoparsec.Number
6import Data.Attoparsec.Number
16−import Data.Data (Typeable, Data)
7+import Data.Data (Data)
17−import Data.Function (on)
8+import Data.Int
18−import Data.Text (Text)
19import Test.Framework (Test, defaultMain, testGroup)
9import Test.Framework (Test, defaultMain, testGroup)
20import Test.Framework.Providers.QuickCheck2 (testProperty)
10import Test.Framework.Providers.QuickCheck2 (testProperty)
21−import Test.QuickCheck (Arbitrary(..), choose, oneof, elements, Gen)
11+import Test.QuickCheck (Arbitrary(..))
22import qualified Data.Vector as V
12import qualified Data.Vector as V
23import qualified Data.Aeson.Generic as G
13import qualified Data.Aeson.Generic as G
24import qualified Data.Attoparsec.Lazy as L
14import qualified Data.Attoparsec.Lazy as L
@@ -26,15 +16,13 @@ import qualified Data.ByteString.Lazy.Char8 as L
26import qualified Data.Text as T
16import qualified Data.Text as T
27import qualified Data.Map as Map
17import qualified Data.Map as Map
28import qualified Data.HashMap.Strict as H
18import qualified Data.HashMap.Strict as H
29−import Data.Time.Calendar (Day)
19+import Data.Time.Clock (UTCTime(..))
30−import Data.Time.Clock (DiffTime, UTCTime(..), picosecondsToDiffTime)
31−import Data.Time (ZonedTime(..), LocalTime(..), TimeZone(..),
20+import Data.Time (ZonedTime(..))
32− hoursToTimeZone, Day(..), TimeOfDay(..))
21+import Types (Foo(..), UFoo(..))
23+import Types (Approx(..), OneConstructor(..), Product2, Product6, Sum4)
33−import Options
24+import Encoders
39encodeDouble :: Double -> Double -> Bool
27encodeDouble :: Double -> Double -> Bool
40encodeDouble num denom
28encodeDouble num denom
@@ -45,6 +33,12 @@ encodeDouble num denom
45encodeInteger :: Integer -> Bool
33encodeInteger :: Integer -> Bool
46encodeInteger i = encode (Number (I i)) == L.pack (show i)
34encodeInteger i = encode (Number (I i)) == L.pack (show i)
36+toParseJSON :: (Arbitrary a, Eq a) => (Value -> Parser a) -> (a -> Value) -> a -> Bool
37+toParseJSON parsejson tojson x =
38+ case parse parsejson . tojson $ x of
40+ Success x' -> x == x'
48roundTrip :: (FromJSON a, ToJSON a) => (a -> a -> Bool) -> a -> a -> Bool
42roundTrip :: (FromJSON a, ToJSON a) => (a -> a -> Bool) -> a -> a -> Bool
49roundTrip eq _ i =
43roundTrip eq _ i =
50 case fmap fromJSON . L.parse value . encode . toJSON $ i of
44 case fmap fromJSON . L.parse value . encode . toJSON $ i of
@@ -60,25 +54,6 @@ genericTo _ v = G.toJSON v == toJSON v
60genericFrom :: (Eq a, Data a, ToJSON a) => a -> a -> Bool
54genericFrom :: (Eq a, Data a, ToJSON a) => a -> a -> Bool
61genericFrom _ v = G.fromJSON (toJSON v) == Success v
55genericFrom _ v = G.fromJSON (toJSON v) == Success v
63−approxEq :: (Fractional a, Ord a) => a -> a -> Bool
64−approxEq = approxEqWith 1e-15 1e-15
66−approxEqWith :: (Fractional a, Ord a) => a -> a -> a -> a -> Bool
67−approxEqWith maxAbsoluteError maxRelativeError a b =
68− a == b || d < maxAbsoluteError ||
69− d / max (abs b) (abs a) <= maxRelativeError
70− where d = abs (a - b)
72−-- Compare equality to within a millisecond, allowing for rounding
73−-- error (ECMA 262 requires milliseconds to rounded to zero, not
74−-- rounded to nearest).
75−approxEqUTC :: UTCTime -> UTCTime -> Bool
76−approxEqUTC a b = ((==) `on` utctDay) a b &&
77− (approxEqWith 1 1 `on` ((* 1e3) . utctDayTime)) a b
79−approxEqNet :: DotNetTime -> DotNetTime -> Bool
80−approxEqNet (DotNetTime a) (DotNetTime b) = approxEqUTC a b
82toFromJSON :: (Arbitrary a, Eq a, FromJSON a, ToJSON a) => a -> Bool
57toFromJSON :: (Arbitrary a, Eq a, FromJSON a, ToJSON a) => a -> Bool
83toFromJSON x = case fromJSON . toJSON $ x of
58toFromJSON x = case fromJSON . toJSON $ x of
84 Error _ -> False
59 Error _ -> False
@@ -89,11 +64,6 @@ genericToFromJSON x = case G.fromJSON . G.toJSON $ x of
89 Error _ -> False
64 Error _ -> False
90 Success x' -> x == x'
65 Success x' -> x == x'
92−toParseJSON :: (Arbitrary a, Eq a) => (Value -> Parser a) -> (a -> Value) -> a -> Bool
93−toParseJSON parsejson tojson x = case parse parsejson . tojson $ x of
95− Success x' -> x == x'
97regress_gh72 :: [(String, Maybe String)] -> Bool
67regress_gh72 :: [(String, Maybe String)] -> Bool
98regress_gh72 ys = G.decode (G.encode m) == Just m
68regress_gh72 ys = G.decode (G.encode m) == Just m
99 where m = Map.fromList ys
69 where m = Map.fromList ys
@@ -106,146 +76,11 @@ modifyFailureProp orig added =
106 result :: Result ()
76 result :: Result ()
107 result = parse parser ()
77 result = parse parser ()
109−data Foo = Foo {
79+main :: IO ()
110− fooInt :: Int
80+main = defaultMain tests
111− , fooDouble :: Double
112− , fooTuple :: (String, Text, Int)
113− -- This definition causes an infinite loop in genericTo and genericFrom!
114− -- , fooMap :: Map.Map String Foo
115− , fooMap :: Map.Map String (Text,Int)
116− } deriving (Show, Typeable, Data)
118−--------------------------------------------------------------------------------
120−--------------------------------------------------------------------------------
122−data Nullary = C1 | C2 | C3 deriving (Eq, Show)
124−instance Arbitrary Nullary where
125− arbitrary = elements [C1, C2, C3]
127−thNullaryToJSONString :: Nullary -> Value
128−thNullaryToJSONString = $(mkToJSON optsDefault ''Nullary)
130−thNullaryParseJSONString :: Value -> Parser Nullary
131−thNullaryParseJSONString = $(mkParseJSON optsDefault ''Nullary)
134−thNullaryToJSON2ElemArray :: Nullary -> Value
135−thNullaryToJSON2ElemArray = $(mkToJSON opts2ElemArray ''Nullary)
137−thNullaryParseJSON2ElemArray :: Value -> Parser Nullary
138−thNullaryParseJSON2ElemArray = $(mkParseJSON opts2ElemArray ''Nullary)
141−thNullaryToJSONObjectWithType :: Nullary -> Value
142−thNullaryToJSONObjectWithType = $(mkToJSON optsObjectWithType ''Nullary)
144−thNullaryParseJSONObjectWithType :: Value -> Parser Nullary
145−thNullaryParseJSONObjectWithType = $(mkParseJSON optsObjectWithType ''Nullary)
148−thNullaryToJSONObjectWithSingleField :: Nullary -> Value
149−thNullaryToJSONObjectWithSingleField = $(mkToJSON optsObjectWithSingleField ''Nullary)
151−thNullaryParseJSONObjectWithSingleField :: Value -> Parser Nullary
152−thNullaryParseJSONObjectWithSingleField = $(mkParseJSON optsObjectWithSingleField ''Nullary)
155−deriving instance Generic Nullary
157−gNullaryToJSONString :: Nullary -> Value
158−gNullaryToJSONString = gToJSON optsDefault . from
160−gNullaryParseJSONString :: Value -> Parser Nullary
161−gNullaryParseJSONString = fmap to . gParseJSON optsDefault
164−gNullaryToJSON2ElemArray :: Nullary -> Value
165−gNullaryToJSON2ElemArray = gToJSON opts2ElemArray . from
167−gNullaryParseJSON2ElemArray :: Value -> Parser Nullary
168−gNullaryParseJSON2ElemArray = fmap to . gParseJSON opts2ElemArray
171−gNullaryToJSONObjectWithType :: Nullary -> Value
172−gNullaryToJSONObjectWithType = gToJSON optsObjectWithType . from
174−gNullaryParseJSONObjectWithType :: Value -> Parser Nullary
175−gNullaryParseJSONObjectWithType = fmap to . gParseJSON optsObjectWithType
178−gNullaryToJSONObjectWithSingleField :: Nullary -> Value
179−gNullaryToJSONObjectWithSingleField = gToJSON optsObjectWithSingleField . from
181−gNullaryParseJSONObjectWithSingleField :: Value -> Parser Nullary
182−gNullaryParseJSONObjectWithSingleField = fmap to . gParseJSON optsObjectWithSingleField
185−--------------------------------------------------------------------------------
187−--------------------------------------------------------------------------------
189−data SomeType a = Nullary
191− | Product String (Maybe Char) a
192− | Record { testOne :: Double
193− , testTwo :: Maybe Bool
194− , testThree :: Maybe a
195− } deriving (Eq, Show)
197−instance Arbitrary a => Arbitrary (SomeType a) where
198− arbitrary = oneof [ pure Nullary
199− , Unary <$> arbitrary
200− , Product <$> arbitrary <*> arbitrary <*> arbitrary
201− , Record <$> arbitrary <*> arbitrary <*> arbitrary
204−type SomeTypeToJSON = SomeType Int -> Value
206−thSomeTypeToJSON2ElemArray :: ToJSON a => SomeType a -> Value
207−thSomeTypeToJSON2ElemArray = $(mkToJSON opts2ElemArray ''SomeType)
209−thSomeTypeParseJSON2ElemArray :: FromJSON a => Value -> Parser (SomeType a)
210−thSomeTypeParseJSON2ElemArray = $(mkParseJSON opts2ElemArray ''SomeType)
213−thSomeTypeToJSONObjectWithType :: ToJSON a => SomeType a -> Value
214−thSomeTypeToJSONObjectWithType = $(mkToJSON optsObjectWithType ''SomeType)
216−thSomeTypeParseJSONObjectWithType :: FromJSON a => Value -> Parser (SomeType a)
217−thSomeTypeParseJSONObjectWithType = $(mkParseJSON optsObjectWithType ''SomeType)
220−thSomeTypeToJSONObjectWithSingleField :: ToJSON a => SomeType a -> Value
221−thSomeTypeToJSONObjectWithSingleField = $(mkToJSON optsObjectWithSingleField ''SomeType)
223−thSomeTypeParseJSONObjectWithSingleField :: FromJSON a => Value -> Parser (SomeType a)
224−thSomeTypeParseJSONObjectWithSingleField = $(mkParseJSON optsObjectWithSingleField ''SomeType)
227−deriving instance Generic (SomeType a)
229−gSomeTypeToJSON2ElemArray :: ToJSON a => SomeType a -> Value
230−gSomeTypeToJSON2ElemArray = gToJSON opts2ElemArray . from
232−gSomeTypeParseJSON2ElemArray :: FromJSON a => Value -> Parser (SomeType a)
233−gSomeTypeParseJSON2ElemArray = fmap to . gParseJSON opts2ElemArray
236−gSomeTypeToJSONObjectWithType :: ToJSON a => SomeType a -> Value
237−gSomeTypeToJSONObjectWithType = gToJSON optsObjectWithType . from
239−gSomeTypeParseJSONObjectWithType :: FromJSON a => Value -> Parser (SomeType a)
240−gSomeTypeParseJSONObjectWithType = fmap to . gParseJSON optsObjectWithType
243−gSomeTypeToJSONObjectWithSingleField :: ToJSON a => SomeType a -> Value
244−gSomeTypeToJSONObjectWithSingleField = gToJSON optsObjectWithSingleField . from
246−gSomeTypeParseJSONObjectWithSingleField :: FromJSON a => Value -> Parser (SomeType a)
82+type P6 = Product6 Int Bool String (Approx Double) (Int, Approx Double) ()
247−gSomeTypeParseJSONObjectWithSingleField = fmap to . gParseJSON optsObjectWithSingleField
83+type S4 = Sum4 Int8 ZonedTime T.Text (Map.Map String Int)
250--------------------------------------------------------------------------------
85--------------------------------------------------------------------------------
251-- Value properties
86-- Value properties
@@ -265,7 +100,7 @@ isObjectWithTypeValue (Object obj) = "type" `H.member` obj &&
265isObjectWithTypeValue _ = False
100isObjectWithTypeValue _ = False
267isObjectWithType :: Value -> Bool
102isObjectWithType :: Value -> Bool
268−isObjectWithType (Object obj) = "type" `H.member` obj
103+isObjectWithType (Object obj) = "type" `H.member` obj
269isObjectWithType _ = False
104isObjectWithType _ = False
271isObjectWithSingleField :: Value -> Bool
106isObjectWithSingleField :: Value -> Bool
@@ -274,72 +109,6 @@ isObjectWithSingleField _ = False
275--------------------------------------------------------------------------------
110--------------------------------------------------------------------------------
277−instance Eq Foo where
278− a == b = fooInt a == fooInt b &&
279− fooDouble a `approxEq` fooDouble b &&
280− fooTuple a == fooTuple b
282−instance ToJSON Foo where
283− toJSON Foo{..} = object [ "fooInt" .= fooInt
284− , "fooDouble" .= fooDouble
285− , "fooTuple" .= fooTuple
286− , "fooMap" .= fooMap
289−instance FromJSON Foo where
290− parseJSON (Object v) = Foo <$>
292− v .: "fooDouble" <*>
297−instance Arbitrary Text where
298− arbitrary = T.pack <$> arbitrary
300−instance (Ord k, Arbitrary k, Arbitrary v) => Arbitrary (Map.Map k v) where
301− arbitrary = Map.fromList <$> arbitrary
303−instance Arbitrary Foo where
304− arbitrary = liftM4 Foo arbitrary arbitrary arbitrary arbitrary
306−instance Arbitrary LocalTime where
307− arbitrary = return $ LocalTime (ModifiedJulianDay 1) (TimeOfDay 1 2 3)
309−instance Arbitrary TimeZone where
311− offset <- choose (0,2) :: Gen Int
312− return $ hoursToTimeZone offset
314−instance Arbitrary Day where
315− arbitrary = ModifiedJulianDay `liftM` arbitrary
317−instance Arbitrary DiffTime where
318− arbitrary = picosecondsToDiffTime `liftM` choose (0, 86400000000000000)
320−instance Arbitrary UTCTime where
321− arbitrary = liftM2 UTCTime arbitrary arbitrary
323−instance Arbitrary DotNetTime where
324− arbitrary = DotNetTime `liftM` arbitrary
326−instance Arbitrary ZonedTime where
327− arbitrary = liftM2 ZonedTime arbitrary arbitrary
332− } deriving (Show, Eq, Data, Typeable)
334−instance Arbitrary UFoo where
335− arbitrary = UFoo <$> arbitrary <*> arbitrary
339−main = defaultMain tests
341−deriving instance Eq ZonedTime
343tests :: [Test]
112tests :: [Test]
345 testGroup "regression" [
114 testGroup "regression" [
@@ -365,15 +134,21 @@ tests = [
366 testGroup "roundTrip" [
135 testGroup "roundTrip" [
367 testProperty "Bool" $ roundTripEq True
136 testProperty "Bool" $ roundTripEq True
368− , testProperty "Double" $ roundTrip approxEq (1::Double)
137+ , testProperty "Double" $ roundTripEq (1 :: Approx Double)
369 , testProperty "Int" $ roundTripEq (1::Int)
138 , testProperty "Int" $ roundTripEq (1::Int)
370 , testProperty "Integer" $ roundTripEq (1::Integer)
139 , testProperty "Integer" $ roundTripEq (1::Integer)
371 , testProperty "String" $ roundTripEq (""::String)
140 , testProperty "String" $ roundTripEq (""::String)
372 , testProperty "Text" $ roundTripEq T.empty
141 , testProperty "Text" $ roundTripEq T.empty
373 , testProperty "Foo" $ roundTripEq (undefined::Foo)
142 , testProperty "Foo" $ roundTripEq (undefined::Foo)
374− , testProperty "DotNetTime" $ roundTrip approxEqNet undefined
143+ , testProperty "DotNetTime" $ roundTripEq (undefined :: Approx DotNetTime)
375− , testProperty "UTCTime" $ roundTrip approxEqUTC undefined
144+ , testProperty "UTCTime" $ roundTripEq (undefined :: Approx UTCTime)
376 , testProperty "ZonedTime" $ roundTripEq (undefined::ZonedTime)
145 , testProperty "ZonedTime" $ roundTripEq (undefined::ZonedTime)
146+ , testGroup "ghcGenerics" [
147+ testProperty "OneConstructor" $ roundTripEq OneConstructor
148+ , testProperty "Product2" $ roundTripEq (undefined :: Product2 Int Bool)
149+ , testProperty "Product6" $ roundTripEq (undefined :: P6)
150+ , testProperty "Sum4" $ roundTripEq (undefined :: S4)
378 testGroup "toFromJSON" [
153 testGroup "toFromJSON" [
379 testProperty "Integer" (toFromJSON :: Integer -> Bool)
154 testProperty "Integer" (toFromJSON :: Integer -> Bool)
@@ -389,52 +164,50 @@ tests = [
389 testProperty "modify failure" modifyFailureProp
164 testProperty "modify failure" modifyFailureProp
391 testGroup "template-haskell" [
166 testGroup "template-haskell" [
392− testGroup "Nullary" [
167+ testGroup "Nullary" [
393− testProperty "string" (isString . thNullaryToJSONString)
168+ testProperty "string" (isString . thNullaryToJSONString)
394− , testProperty "2ElemArray" (is2ElemArray . thNullaryToJSON2ElemArray)
169+ , testProperty "2ElemArray" (is2ElemArray . thNullaryToJSON2ElemArray)
395− , testProperty "ObjectWithType" (isObjectWithTypeValue . thNullaryToJSONObjectWithType)
170+ , testProperty "ObjectWithType" (isObjectWithTypeValue . thNullaryToJSONObjectWithType)
396− , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thNullaryToJSONObjectWithSingleField)
171+ , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thNullaryToJSONObjectWithSingleField)
398− , testGroup "roundTrip" [
173+ , testGroup "roundTrip" [
399− testProperty "string" (toParseJSON thNullaryParseJSONString thNullaryToJSONString)
174+ testProperty "string" (toParseJSON thNullaryParseJSONString thNullaryToJSONString)
400− , testProperty "2ElemArray" (toParseJSON thNullaryParseJSON2ElemArray thNullaryToJSON2ElemArray)
175+ , testProperty "2ElemArray" (toParseJSON thNullaryParseJSON2ElemArray thNullaryToJSON2ElemArray)
401− , testProperty "ObjectWithType" (toParseJSON thNullaryParseJSONObjectWithType thNullaryToJSONObjectWithType)
176+ , testProperty "ObjectWithType" (toParseJSON thNullaryParseJSONObjectWithType thNullaryToJSONObjectWithType)
402− , testProperty "ObjectWithSingleField" (toParseJSON thNullaryParseJSONObjectWithSingleField thNullaryToJSONObjectWithSingleField)
177+ , testProperty "ObjectWithSingleField" (toParseJSON thNullaryParseJSONObjectWithSingleField thNullaryToJSONObjectWithSingleField)
405− , testGroup "SomeType" [
180+ , testGroup "SomeType" [
406− testProperty "2ElemArray" (is2ElemArray . (thSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
181+ testProperty "2ElemArray" (is2ElemArray . (thSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
407− , testProperty "ObjectWithType" (isObjectWithType . (thSomeTypeToJSONObjectWithType :: SomeTypeToJSON))
182+ , testProperty "ObjectWithType" (isObjectWithType . (thSomeTypeToJSONObjectWithType :: SomeTypeToJSON))
408− , testProperty "ObjectWithSingleField" (isObjectWithSingleField . (thSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
183+ , testProperty "ObjectWithSingleField" (isObjectWithSingleField . (thSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
410− , testGroup "roundTrip" [
185+ , testGroup "roundTrip" [
411− testProperty "2ElemArray" (toParseJSON thSomeTypeParseJSON2ElemArray (thSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
186+ testProperty "2ElemArray" (toParseJSON thSomeTypeParseJSON2ElemArray (thSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
412− , testProperty "ObjectWithType" (toParseJSON thSomeTypeParseJSONObjectWithType (thSomeTypeToJSONObjectWithType :: SomeTypeToJSON))
187+ , testProperty "ObjectWithType" (toParseJSON thSomeTypeParseJSONObjectWithType (thSomeTypeToJSONObjectWithType :: SomeTypeToJSON))
413− , testProperty "ObjectWithSingleField" (toParseJSON thSomeTypeParseJSONObjectWithSingleField (thSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
188+ , testProperty "ObjectWithSingleField" (toParseJSON thSomeTypeParseJSONObjectWithSingleField (thSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
418 , testGroup "GHC-generics" [
192 , testGroup "GHC-generics" [
419− testGroup "Nullary" [
193+ testGroup "Nullary" [
420− testProperty "string" (isString . gNullaryToJSONString)
194+ testProperty "string" (isString . gNullaryToJSONString)
421− , testProperty "2ElemArray" (is2ElemArray . gNullaryToJSON2ElemArray)
195+ , testProperty "2ElemArray" (is2ElemArray . gNullaryToJSON2ElemArray)
422− , testProperty "ObjectWithType" (isObjectWithTypeValue . gNullaryToJSONObjectWithType)
196+ , testProperty "ObjectWithType" (isObjectWithTypeValue . gNullaryToJSONObjectWithType)
423− , testProperty "ObjectWithSingleField" (isObjectWithSingleField . gNullaryToJSONObjectWithSingleField)
197+ , testProperty "ObjectWithSingleField" (isObjectWithSingleField . gNullaryToJSONObjectWithSingleField)
425− , testGroup "eq" [
198+ , testGroup "eq" [
426− testProperty "string" (\n -> gNullaryToJSONString n == thNullaryToJSONString n)
199+ testProperty "string" (\n -> gNullaryToJSONString n == thNullaryToJSONString n)
427− , testProperty "2ElemArray" (\n -> gNullaryToJSON2ElemArray n == thNullaryToJSON2ElemArray n)
200+ , testProperty "2ElemArray" (\n -> gNullaryToJSON2ElemArray n == thNullaryToJSON2ElemArray n)
428− , testProperty "ObjectWithType" (\n -> gNullaryToJSONObjectWithType n == thNullaryToJSONObjectWithType n)
201+ , testProperty "ObjectWithType" (\n -> gNullaryToJSONObjectWithType n == thNullaryToJSONObjectWithType n)
429− , testProperty "ObjectWithSingleField" (\n -> gNullaryToJSONObjectWithSingleField n == thNullaryToJSONObjectWithSingleField n)
202+ , testProperty "ObjectWithSingleField" (\n -> gNullaryToJSONObjectWithSingleField n == thNullaryToJSONObjectWithSingleField n)
431− , testGroup "roundTrip" [
204+ , testGroup "roundTrip" [
432− testProperty "string" (toParseJSON gNullaryParseJSONString gNullaryToJSONString)
205+ testProperty "string" (toParseJSON gNullaryParseJSONString gNullaryToJSONString)
433− , testProperty "2ElemArray" (toParseJSON gNullaryParseJSON2ElemArray gNullaryToJSON2ElemArray)
206+ , testProperty "2ElemArray" (toParseJSON gNullaryParseJSON2ElemArray gNullaryToJSON2ElemArray)
434− , testProperty "ObjectWithType" (toParseJSON gNullaryParseJSONObjectWithType gNullaryToJSONObjectWithType)
207+ , testProperty "ObjectWithType" (toParseJSON gNullaryParseJSONObjectWithType gNullaryToJSONObjectWithType)
435− , testProperty "ObjectWithSingleField" (toParseJSON gNullaryParseJSONObjectWithSingleField gNullaryToJSONObjectWithSingleField)
208+ , testProperty "ObjectWithSingleField" (toParseJSON gNullaryParseJSONObjectWithSingleField gNullaryToJSONObjectWithSingleField)
438 , testGroup "SomeType" [
211 , testGroup "SomeType" [
439 testProperty "2ElemArray" (is2ElemArray . (gSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
212 testProperty "2ElemArray" (is2ElemArray . (gSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
440 , testProperty "ObjectWithType" (isObjectWithType . (gSomeTypeToJSONObjectWithType :: SomeTypeToJSON))
213 , testProperty "ObjectWithType" (isObjectWithType . (gSomeTypeToJSONObjectWithType :: SomeTypeToJSON))
@@ -450,7 +223,6 @@ tests = [
450 , testProperty "ObjectWithType" (toParseJSON gSomeTypeParseJSONObjectWithType (gSomeTypeToJSONObjectWithType :: SomeTypeToJSON))
223 , testProperty "ObjectWithType" (toParseJSON gSomeTypeParseJSONObjectWithType (gSomeTypeToJSONObjectWithType :: SomeTypeToJSON))
451 , testProperty "ObjectWithSingleField" (toParseJSON gSomeTypeParseJSONObjectWithSingleField (gSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
224 , testProperty "ObjectWithSingleField" (toParseJSON gSomeTypeParseJSONObjectWithSingleField (gSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))