Skip to content

Commit 53f4302

Browse files
committed
Add test for union in regression #172
1 parent 03f0b9b commit 53f4302

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/FSharp.SystemTextJson.Tests/Test.Regression.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,14 @@ let ``regression #154`` () =
113113
|> ignore
114114

115115
type X = { X: X }
116+
type UY = UY of int * int
117+
type Y = { Y: UY }
116118

117119
[<Fact>]
118120
let ``regression #172`` () =
119121
let x = { X = Unchecked.defaultof<_> }
122+
let y = { Y = Unchecked.defaultof<_> }
120123
let options = JsonSerializerOptions()
121124
options.Converters.Add(JsonFSharpConverter())
122125
Assert.Equal("{\"X\":null}", JsonSerializer.Serialize(x, options))
126+
Assert.Equal("{\"Y\":null}", JsonSerializer.Serialize(y, options))

0 commit comments

Comments
 (0)