diff --git a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs index b363c7f63f769..5304134240476 100644 --- a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs @@ -862,12 +862,12 @@ private static void AssertWriteValue(object value, string expectedJson, JsonForm /// /// Checks that the actual JSON is the same as the expected JSON - but after replacing - /// all apostrophes in the expected JSON with double quotes and trimming leading whitespace. + /// all apostrophes in the expected JSON with double quotes, trimming leading whitespace and normalizing new lines. /// This basically makes the tests easier to read. /// private static void AssertJson(string expectedJsonWithApostrophes, string actualJson) { - var expectedJson = expectedJsonWithApostrophes.Replace("'", "\"").TrimStart(); + var expectedJson = expectedJsonWithApostrophes.Replace("'", "\"").Replace("\r\n", "\n").TrimStart(); Assert.AreEqual(expectedJson, actualJson); } }