File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ tests = testGroup "unit" [
91
91
, testGroup " FromJSONKey" $ fmap (testCase " -" ) fromJSONKeyAssertions
92
92
, testCase " PR #455" pr455
93
93
, testCase " Unescape string (PR #477)" unescapeString
94
+ , testCase " Show Options" showOptions
94
95
]
95
96
96
97
roundTripCamel :: String -> Assertion
@@ -483,6 +484,20 @@ pr455 = assertEqual "FooCons FooNil"
483
484
foo :: Foo Int
484
485
foo = FooCons FooNil
485
486
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
+
486
501
deriveJSON defaultOptions{omitNothingFields= True } ''MyRecord
487
502
488
503
deriveToJSON defaultOptions ''Foo
You can’t perform that action at this time.
0 commit comments