on master help sign in
More TH tests
commit9d39e9d2fda9df482f1c9f008eb16f087635c81a authorBryan O'Sullivan <bos@serpentine.com> dateThu 2 Jul 2015, 15:41 (11 years ago) parent249abb2
2 files changed+10
tests/Encoders.hs+6 tests/Properties.hs+4
tests/Encoders.hs+6
@@ -135,6 +135,9 @@ gSomeTypeParseJSONObjectWithSingleField = genericParseJSON optsObjectWithSingleF
135135thApproxToJSONUnwrap :: Approx String -> Value
136136thApproxToJSONUnwrap = $(mkToJSON optsUnwrapUnaryRecords ''Approx)
137137
138+thApproxToEncodingUnwrap :: Approx String -> Encoding
139+thApproxToEncodingUnwrap = $(mkToEncoding optsUnwrapUnaryRecords ''Approx)
140+
138141thApproxParseJSONUnwrap :: Value -> Parser (Approx String)
139142thApproxParseJSONUnwrap = $(mkParseJSON optsUnwrapUnaryRecords ''Approx)
140143
@@ -142,6 +145,9 @@ thApproxParseJSONUnwrap = $(mkParseJSON optsUnwrapUnaryRecords ''Approx)
142145thApproxToJSONDefault :: Approx String -> Value
143146thApproxToJSONDefault = $(mkToJSON defaultOptions ''Approx)
144147
148+thApproxToEncodingDefault :: Approx String -> Encoding
149+thApproxToEncodingDefault = $(mkToEncoding defaultOptions ''Approx)
150+
145151thApproxParseJSONDefault :: Value -> Parser (Approx String)
146152thApproxParseJSONDefault = $(mkParseJSON defaultOptions ''Approx)
147153
tests/Properties.hs+4
@@ -201,6 +201,10 @@ tests = [
201201 , testProperty "NullaryObjectWithSingleField" $
202202 thNullaryToJSONObjectWithSingleField `sameAs`
203203 thNullaryToEncodingObjectWithSingleField
204+ , testProperty "ApproxUnwrap" $
205+ thApproxToJSONUnwrap `sameAs` thApproxToEncodingUnwrap
206+ , testProperty "ApproxDefault" $
207+ thApproxToJSONDefault `sameAs` thApproxToEncodingDefault
204208 ]
205209 ]
206210 ]