@@ -91,6 +91,7 @@ tests = testGroup "unit" [
9191 , testGroup "FromJSONKey" $ fmap (testCase "-") fromJSONKeyAssertions
9292 , testCase "PR #455" pr455
9393 , testCase "Unescape string (PR #477)" unescapeString
94+ , testCase "Show Options" showOptions
9495 ]
9596
9697roundTripCamel :: String -> Assertion
@@ -483,6 +484,20 @@ pr455 = assertEqual "FooCons FooNil"
483484 foo :: Foo Int
484485 foo = FooCons FooNil
485486
487+showOptions :: Assertion
488+showOptions =
489+ assertEqual
490+ "Show Options"
491+ ( "Options {"
492+ ++ "fieldLabelModifier =~ \"exampleField\""
493+ ++ ", constructorTagModifier =~ \"ExampleConstructor\""
494+ ++ ", allNullaryToStringTag = True"
495+ ++ ", omitNothingFields = False"
496+ ++ ", sumEncoding = TaggedObject {tagFieldName = \"tag\", contentsFieldName = \"contents\"}"
497+ ++ ", unwrapUnaryRecords = False"
498+ ++ "}")
499+ (show defaultOptions)
500+
486501deriveJSON defaultOptions{omitNothingFields=True} ''MyRecord
487502
488503deriveToJSON defaultOptions ''Foo