on master help sign in
Another TH test, and yes, another bug fix
commit2f8e6d272bd332a64e68c34c8ed1d47d56352d3b authorBryan O'Sullivan <bos@serpentine.com> dateThu 2 Jul 2015, 15:24 (11 years ago) parent750b495
3 files changed+8−1
Data/Aeson/TH.hs+1−1 tests/Encoders.hs+4 tests/Properties.hs+3
Data/Aeson/TH.hs+1−1
@@ -438,7 +438,7 @@ sumToEncoding opts multiCons conName exp
438438 ([|E.builder tagFieldName|] <:> encStr opts conName) <%>
439439 ([|E.builder contentsFieldName|] <:> fexp)
440440 ObjectWithSingleField ->
441− object (conTxt opts conName <:> fexp)
441+ object (encStr opts conName <:> fexp)
442442
443443 | otherwise = exp
444444
tests/Encoders.hs+4
@@ -45,6 +45,10 @@ thNullaryToJSONObjectWithSingleField :: Nullary -> Value
4545thNullaryToJSONObjectWithSingleField =
4646 $(mkToJSON optsObjectWithSingleField ''Nullary)
4747
48+thNullaryToEncodingObjectWithSingleField :: Nullary -> Encoding
49+thNullaryToEncodingObjectWithSingleField =
50+ $(mkToEncoding optsObjectWithSingleField ''Nullary)
51+
4852thNullaryParseJSONObjectWithSingleField :: Value -> Parser Nullary
4953thNullaryParseJSONObjectWithSingleField = $(mkParseJSON optsObjectWithSingleField ''Nullary)
5054
tests/Properties.hs+3
@@ -198,6 +198,9 @@ tests = [
198198 thNullaryToJSON2ElemArray `sameAs` thNullaryToEncoding2ElemArray
199199 , testProperty "NullaryTaggedObject" $
200200 thNullaryToJSONTaggedObject `sameAs` thNullaryToEncodingTaggedObject
201+ , testProperty "NullaryObjectWithSingleField" $
202+ thNullaryToJSONObjectWithSingleField `sameAs`
203+ thNullaryToEncodingObjectWithSingleField
201204 ]
202205 ]
203206 ]