-Fixed integer parsing overflow bug

This commit is contained in:
James Newton-King
2013-03-30 17:39:08 +13:00
parent 73187dde1e
commit bef6c4c11a
2 changed files with 19 additions and 13 deletions
@@ -1134,6 +1134,7 @@ bye", reader.Value);
Assert.AreEqual(int.MinValue, reader.ReadAsInt32());
reader = new JsonTextReader(new StringReader(long.MaxValue.ToString()));
ExceptionAssert.Throws<OverflowException>("Arithmetic operation resulted in an overflow.", () => reader.ReadAsInt32());
reader = new JsonTextReader(new StringReader("1E-06"));
ExceptionAssert.Throws<FormatException>("Input string was not in a correct format.", () => reader.ReadAsInt32());