From 76f44be2f3a80ecdeb3798f5c85feeebbb9ac14a Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Wed, 23 Jun 2004 14:52:50 +0000 Subject: [PATCH] 2004-06-23 Sebastien Pouliot * DoubleFormatterTest.cs: Added a new test for a negative roundtrip (which was broken). svn path=/trunk/mcs/; revision=30203 --- mcs/class/corlib/Test/System/ChangeLog | 5 +++++ mcs/class/corlib/Test/System/DoubleFormatterTest.cs | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/mcs/class/corlib/Test/System/ChangeLog b/mcs/class/corlib/Test/System/ChangeLog index c930e9e3bbd..b271ba154f9 100644 --- a/mcs/class/corlib/Test/System/ChangeLog +++ b/mcs/class/corlib/Test/System/ChangeLog @@ -1,3 +1,8 @@ +2004-06-23 Sebastien Pouliot + + * DoubleFormatterTest.cs: Added a new test for a negative roundtrip + (which was broken). + 2004-06-19 Atsushi Enomoto * FloatingPointFormatterTest.cs : Format literal (i.e. '...') in diff --git a/mcs/class/corlib/Test/System/DoubleFormatterTest.cs b/mcs/class/corlib/Test/System/DoubleFormatterTest.cs index e7a2386f1f0..3216945c8f7 100644 --- a/mcs/class/corlib/Test/System/DoubleFormatterTest.cs +++ b/mcs/class/corlib/Test/System/DoubleFormatterTest.cs @@ -939,7 +939,17 @@ namespace MonoTests.System { // we try MS "short" R format se = "2.7182818284590451"; de = Double.Parse (se); - AssertEquals ("Mono==E", Math.E, de); + AssertEquals ("Microsoft==E", Math.E, de); + } + + [Test] + public void NegativeRoundtrip () + { + Double value = -Math.E; + // here we check that we can recreate the "extact" same double from the "R" format + string se = value.ToString ("R", CultureInfo.InvariantCulture); + Double de = Double.Parse (se); + AssertEquals ("-E==-E", value, de); } } } -- 2.25.1