diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/PrintfTests.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/PrintfTests.fs index 187fa62c60e..622e5370cbc 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/PrintfTests.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/PrintfTests.fs @@ -75,6 +75,16 @@ type PrintfTests() = Assert.AreEqual(" 7B", sprintf "%*X" 8 123 ) Assert.AreEqual("7B ", sprintf "%-*X" 8 123 ) + + [] + member this.``positive and negative zero``() = + test "%f" +0.0 "0.000000" + test "%f" -0.0 "-0.000000" + test "%f" -0.0000001 "-0.000000" + test "%+f" +0.0 "+0.000000" + test "%+f" -0.0 "-0.000000" + test "%+f" -0.0000001 "-0.000000" + [] member _.``union case formatting`` () = Assert.AreEqual("CaseOne", sprintf "%A" CaseOne)