Changed tests to explicitly assert for strings with \r\n

As opposed to leaving it up to the IDE to decide at compile time by having newlines in the actual document
This commit is contained in:
Redth
2014-09-09 09:35:01 -04:00
parent fc9c3ad720
commit aa6c474999
4 changed files with 7 additions and 74 deletions
+2 -4
View File
@@ -342,8 +342,7 @@ namespace Newtonsoft.Json.Tests
result = JavaScriptUtils.ToEscapedJavaScriptString("How now <brown> cow?", '"', true);
Assert.AreEqual(@"""How now <brown> cow?""", result);
result = JavaScriptUtils.ToEscapedJavaScriptString(@"How
now brown cow?", '"', true);
result = JavaScriptUtils.ToEscapedJavaScriptString("How \r\nnow brown cow?", '"', true);
Assert.AreEqual(@"""How \r\nnow brown cow?""", result);
result = JavaScriptUtils.ToEscapedJavaScriptString("\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007", '"', true);
@@ -576,8 +575,7 @@ now brown cow?", '"', true);
[Test]
public void StringEscaping()
{
string v = @"It's a good day
""sunshine""";
string v = "It's a good day\r\n\"sunshine\"";
string json = JsonConvert.ToString(v);
Assert.AreEqual(@"""It's a good day\r\n\""sunshine\""""", json);