@@ -184,13 +184,13 @@ tests = [
184184 testGroup "encode" [
185185 testProperty "encodeDouble" encodeDouble
186186 , testProperty "encodeInteger" encodeInteger
187− ],
188− testGroup "camelCase" [
187+ ]
188+ , testGroup "camelCase" [
189189 testCase "camelTo" $ roundTripCamel "aName"
190190 , testCase "camelTo" $ roundTripCamel "another"
191191 , testCase "camelTo" $ roundTripCamel "someOtherName"
192− ],
193− testGroup "roundTrip" [
192+ ]
193+ , testGroup "roundTrip" [
194194 testProperty "Bool" $ roundTripEq True
195195 , testProperty "Double" $ roundTripEq (1 :: Approx Double)
196196 , testProperty "Int" $ roundTripEq (1 :: Int)
@@ -207,78 +207,76 @@ tests = [
207207 , testProperty "Product6" $ roundTripEq (undefined :: P6)
208208 , testProperty "Sum4" $ roundTripEq (undefined :: S4)
209209 ]
210− ],
211− testGroup "toFromJSON" [
210+ ]
211+ , testGroup "toFromJSON" [
212212 testProperty "Integer" (toFromJSON :: Integer -> Bool)
213213 , testProperty "Double" (toFromJSON :: Double -> Bool)
214214 , testProperty "Maybe Integer" (toFromJSON :: Maybe Integer -> Bool)
215215 , testProperty "Either Integer Double" (toFromJSON :: Either Integer Double -> Bool)
216216 , testProperty "Either Integer Integer" (toFromJSON :: Either Integer Integer -> Bool)
217217 , testProperty "ZonedTime" $ zonedTimeToJSON
218− ],
219− testGroup "failure messages" [
218+ ]
219+ , testGroup "failure messages" [
220220 testProperty "modify failure" modifyFailureProp
221− ],
222− testGroup "template-haskell" [
221+ ]
222+ , testGroup "template-haskell" [
223223 testGroup "Nullary" [
224− testProperty "string" (isString . thNullaryToJSONString)
225− , testProperty "2ElemArray" (is2ElemArray . thNullaryToJSON2ElemArray)
226− , testProperty "TaggedObject" (isTaggedObjectValue . thNullaryToJSONTaggedObject)
224+ testProperty "string" (isString . thNullaryToJSONString)
225+ , testProperty "2ElemArray" (is2ElemArray . thNullaryToJSON2ElemArray)
226+ , testProperty "TaggedObject" (isTaggedObjectValue . thNullaryToJSONTaggedObject)
227227 , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thNullaryToJSONObjectWithSingleField)
228228
229229 , testGroup "roundTrip" [
230− testProperty "string" (toParseJSON thNullaryParseJSONString thNullaryToJSONString)
231− , testProperty "2ElemArray" (toParseJSON thNullaryParseJSON2ElemArray thNullaryToJSON2ElemArray)
232− , testProperty "TaggedObject" (toParseJSON thNullaryParseJSONTaggedObject thNullaryToJSONTaggedObject)
233− , testProperty "ObjectWithSingleField" (toParseJSON thNullaryParseJSONObjectWithSingleField thNullaryToJSONObjectWithSingleField)
230+ testProperty "string" (toParseJSON thNullaryParseJSONString thNullaryToJSONString)
231+ , testProperty "2ElemArray" (toParseJSON thNullaryParseJSON2ElemArray thNullaryToJSON2ElemArray)
232+ , testProperty "TaggedObject" (toParseJSON thNullaryParseJSONTaggedObject thNullaryToJSONTaggedObject)
233+ , testProperty "ObjectWithSingleField" (toParseJSON thNullaryParseJSONObjectWithSingleField thNullaryToJSONObjectWithSingleField)
234234 ]
235− ]
235+ ]
236236 , testGroup "SomeType" [
237− testProperty "2ElemArray" (is2ElemArray . (thSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
238− , testProperty "TaggedObject" (isTaggedObject . (thSomeTypeToJSONTaggedObject :: SomeTypeToJSON))
239− , testProperty "ObjectWithSingleField" (isObjectWithSingleField . (thSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
240−
241− , testGroup "roundTrip" [
242− testProperty "2ElemArray" (toParseJSON thSomeTypeParseJSON2ElemArray (thSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
243− , testProperty "TaggedObject" (toParseJSON thSomeTypeParseJSONTaggedObject (thSomeTypeToJSONTaggedObject :: SomeTypeToJSON))
244− , testProperty "ObjectWithSingleField" (toParseJSON thSomeTypeParseJSONObjectWithSingleField (thSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
245− ]
237+ testProperty "2ElemArray" (is2ElemArray . (thSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
238+ , testProperty "TaggedObject" (isTaggedObject . (thSomeTypeToJSONTaggedObject :: SomeTypeToJSON))
239+ , testProperty "ObjectWithSingleField" (isObjectWithSingleField . (thSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
240+ , testGroup "roundTrip" [
241+ testProperty "2ElemArray" (toParseJSON thSomeTypeParseJSON2ElemArray (thSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
242+ , testProperty "TaggedObject" (toParseJSON thSomeTypeParseJSONTaggedObject (thSomeTypeToJSONTaggedObject :: SomeTypeToJSON))
243+ , testProperty "ObjectWithSingleField" (toParseJSON thSomeTypeParseJSONObjectWithSingleField (thSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
244+ ]
246245 ]
247246 ]
248− , testGroup "GHC-generics" [
249− testGroup "Nullary" [
250− testProperty "string" (isString . gNullaryToJSONString)
251− , testProperty "2ElemArray" (is2ElemArray . gNullaryToJSON2ElemArray)
252− , testProperty "TaggedObject" (isTaggedObjectValue . gNullaryToJSONTaggedObject)
253− , testProperty "ObjectWithSingleField" (isObjectWithSingleField . gNullaryToJSONObjectWithSingleField)
254− , testGroup "eq" [
255− testProperty "string" (\n -> gNullaryToJSONString n == thNullaryToJSONString n)
256− , testProperty "2ElemArray" (\n -> gNullaryToJSON2ElemArray n == thNullaryToJSON2ElemArray n)
257− , testProperty "TaggedObject" (\n -> gNullaryToJSONTaggedObject n == thNullaryToJSONTaggedObject n)
258− , testProperty "ObjectWithSingleField" (\n -> gNullaryToJSONObjectWithSingleField n == thNullaryToJSONObjectWithSingleField n)
259− ]
260− , testGroup "roundTrip" [
261− testProperty "string" (toParseJSON gNullaryParseJSONString gNullaryToJSONString)
262− , testProperty "2ElemArray" (toParseJSON gNullaryParseJSON2ElemArray gNullaryToJSON2ElemArray)
263− , testProperty "TaggedObject" (toParseJSON gNullaryParseJSONTaggedObject gNullaryToJSONTaggedObject)
264− , testProperty "ObjectWithSingleField" (toParseJSON gNullaryParseJSONObjectWithSingleField gNullaryToJSONObjectWithSingleField)
265− ]
266− ]
247+ , testGroup "generics" [
248+ testGroup "Nullary" [
249+ testProperty "string" (isString . gNullaryToJSONString)
250+ , testProperty "2ElemArray" (is2ElemArray . gNullaryToJSON2ElemArray)
251+ , testProperty "TaggedObject" (isTaggedObjectValue . gNullaryToJSONTaggedObject)
252+ , testProperty "ObjectWithSingleField" (isObjectWithSingleField . gNullaryToJSONObjectWithSingleField)
253+ , testGroup "eq" [
254+ testProperty "string" (\n -> gNullaryToJSONString n == thNullaryToJSONString n)
255+ , testProperty "2ElemArray" (\n -> gNullaryToJSON2ElemArray n == thNullaryToJSON2ElemArray n)
256+ , testProperty "TaggedObject" (\n -> gNullaryToJSONTaggedObject n == thNullaryToJSONTaggedObject n)
257+ , testProperty "ObjectWithSingleField" (\n -> gNullaryToJSONObjectWithSingleField n == thNullaryToJSONObjectWithSingleField n)
258+ ]
259+ , testGroup "roundTrip" [
260+ testProperty "string" (toParseJSON gNullaryParseJSONString gNullaryToJSONString)
261+ , testProperty "2ElemArray" (toParseJSON gNullaryParseJSON2ElemArray gNullaryToJSON2ElemArray)
262+ , testProperty "TaggedObject" (toParseJSON gNullaryParseJSONTaggedObject gNullaryToJSONTaggedObject)
263+ , testProperty "ObjectWithSingleField" (toParseJSON gNullaryParseJSONObjectWithSingleField gNullaryToJSONObjectWithSingleField)
264+ ]
265+ ]
267266 , testGroup "SomeType" [
268− testProperty "2ElemArray" (is2ElemArray . (gSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
269− , testProperty "TaggedObject" (isTaggedObject . (gSomeTypeToJSONTaggedObject :: SomeTypeToJSON))
270− , testProperty "ObjectWithSingleField" (isObjectWithSingleField . (gSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
271−
272− , testGroup "eq" [
273− testProperty "2ElemArray" (\n -> (gSomeTypeToJSON2ElemArray :: SomeTypeToJSON) n == thSomeTypeToJSON2ElemArray n)
274− , testProperty "TaggedObject" (\n -> (gSomeTypeToJSONTaggedObject :: SomeTypeToJSON) n == thSomeTypeToJSONTaggedObject n)
275− , testProperty "ObjectWithSingleField" (\n -> (gSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON) n == thSomeTypeToJSONObjectWithSingleField n)
276− ]
277− , testGroup "roundTrip" [
278− testProperty "2ElemArray" (toParseJSON gSomeTypeParseJSON2ElemArray (gSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
279− , testProperty "TaggedObject" (toParseJSON gSomeTypeParseJSONTaggedObject (gSomeTypeToJSONTaggedObject :: SomeTypeToJSON))
280− , testProperty "ObjectWithSingleField" (toParseJSON gSomeTypeParseJSONObjectWithSingleField (gSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
281− ]
267+ testProperty "2ElemArray" (is2ElemArray . (gSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
268+ , testProperty "TaggedObject" (isTaggedObject . (gSomeTypeToJSONTaggedObject :: SomeTypeToJSON))
269+ , testProperty "ObjectWithSingleField" (isObjectWithSingleField . (gSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
270+ , testGroup "eq" [
271+ testProperty "2ElemArray" (\n -> (gSomeTypeToJSON2ElemArray :: SomeTypeToJSON) n == thSomeTypeToJSON2ElemArray n)
272+ , testProperty "TaggedObject" (\n -> (gSomeTypeToJSONTaggedObject :: SomeTypeToJSON) n == thSomeTypeToJSONTaggedObject n)
273+ , testProperty "ObjectWithSingleField" (\n -> (gSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON) n == thSomeTypeToJSONObjectWithSingleField n)
274+ ]
275+ , testGroup "roundTrip" [
276+ testProperty "2ElemArray" (toParseJSON gSomeTypeParseJSON2ElemArray (gSomeTypeToJSON2ElemArray :: SomeTypeToJSON))
277+ , testProperty "TaggedObject" (toParseJSON gSomeTypeParseJSONTaggedObject (gSomeTypeToJSONTaggedObject :: SomeTypeToJSON))
278+ , testProperty "ObjectWithSingleField" (toParseJSON gSomeTypeParseJSONObjectWithSingleField (gSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
279+ ]
282280 ]
283281 ]
284282 ]