-Tests
This commit is contained in:
@@ -1063,6 +1063,27 @@ third line", jsonTextReader.Value);
|
||||
Assert.AreEqual(JsonToken.Null, reader.TokenType);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void UnexpectedEndAfterReadingN()
|
||||
{
|
||||
JsonTextReader reader = new JsonTextReader(new StringReader("n"));
|
||||
ExceptionAssert.Throws<JsonReaderException>(() => reader.Read(), "Unexpected end when reading JSON. Path '', line 1, position 1.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void UnexpectedEndAfterReadingNu()
|
||||
{
|
||||
JsonTextReader reader = new JsonTextReader(new StringReader("nu"));
|
||||
ExceptionAssert.Throws<JsonReaderException>(() => reader.Read(), "Unexpected end when reading JSON. Path '', line 1, position 2.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void UnexpectedEndAfterReadingNe()
|
||||
{
|
||||
JsonTextReader reader = new JsonTextReader(new StringReader("ne"));
|
||||
ExceptionAssert.Throws<JsonReaderException>(() => reader.Read(), "Unexpected end when reading JSON. Path '', line 1, position 2.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ReadInt32Overflow()
|
||||
{
|
||||
|
||||
@@ -1564,7 +1564,8 @@ namespace Newtonsoft.Json
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateUnexpectedEndException();
|
||||
_charPos++;
|
||||
throw CreateUnexpectedEndException();
|
||||
}
|
||||
return true;
|
||||
case 'N':
|
||||
|
||||
Reference in New Issue
Block a user