-Tests
This commit is contained in:
@@ -76,7 +76,7 @@ namespace Newtonsoft.Json.Tests.JsonTextReaderTests
|
||||
{
|
||||
JsonReader reader = new JsonTextReader(new StringReader(@"'h\u123"));
|
||||
|
||||
await ExceptionAssert.ThrowsAsync<JsonReaderException>(async () => { await reader.ReadAsync(); }, "Unexpected end while parsing Unicode character. Path '', line 1, position 4.");
|
||||
await ExceptionAssert.ThrowsAsync<JsonReaderException>(async () => { await reader.ReadAsync(); }, "Unexpected end while parsing Unicode escape sequence. Path '', line 1, position 4.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Newtonsoft.Json.Tests.JsonTextReaderTests
|
||||
{
|
||||
JsonReader reader = new JsonTextReader(new StringReader(@"'h\u123"));
|
||||
|
||||
ExceptionAssert.Throws<JsonReaderException>(() => { reader.Read(); }, "Unexpected end while parsing Unicode character. Path '', line 1, position 4.");
|
||||
ExceptionAssert.Throws<JsonReaderException>(() => { reader.Read(); }, "Unexpected end while parsing Unicode escape sequence. Path '', line 1, position 4.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -983,9 +983,10 @@ null//comment
|
||||
|
||||
Assert.IsFalse(await r.ReadAsync());
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public async Task InvalidUnicodeSequence()
|
||||
public async Task InvalidUnicodeSequenceAsync()
|
||||
{
|
||||
string json1 = @"{'prop':'\u123!'}";
|
||||
|
||||
@@ -996,7 +997,6 @@ null//comment
|
||||
|
||||
await ExceptionAssert.ThrowsAsync<JsonReaderException>(async () => { await r.ReadAsync(); }, @"Invalid Unicode escape sequence: \u123!. Path 'prop', line 1, position 11.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user