-DoubleTryParse fixes and tests
This commit is contained in:
@@ -1843,14 +1843,10 @@ third line", jsonTextReader.Value);
|
||||
Assert.AreEqual(Double.MinValue, reader.Value);
|
||||
|
||||
reader = new JsonTextReader(new StringReader("1E+309"));
|
||||
Assert.IsTrue(reader.Read());
|
||||
Assert.AreEqual(typeof(double), reader.ValueType);
|
||||
Assert.AreEqual(Double.PositiveInfinity, reader.Value);
|
||||
ExceptionAssert.Throws<JsonReaderException>(() => reader.Read(), "Input string '1E+309' is not a valid number. Path '', line 1, position 6.");
|
||||
|
||||
reader = new JsonTextReader(new StringReader("-1E+5000"));
|
||||
Assert.IsTrue(reader.Read());
|
||||
Assert.AreEqual(typeof(double), reader.ValueType);
|
||||
Assert.AreEqual(Double.NegativeInfinity, reader.Value);
|
||||
ExceptionAssert.Throws<JsonReaderException>(() => reader.Read(), "Input string '-1E+5000' is not a valid number. Path '', line 1, position 8.");
|
||||
|
||||
reader = new JsonTextReader(new StringReader("5.1231231E"));
|
||||
ExceptionAssert.Throws<JsonReaderException>(() => reader.Read(), "Input string '5.1231231E' is not a valid number. Path '', line 1, position 10.");
|
||||
|
||||
Reference in New Issue
Block a user