ソースを参照

Fix newline assertion in TestJsonFormatted on mono

Jan Tattermusch 10 年 前
コミット
3ccbf4b893
1 ファイル変更2 行追加1 行削除
  1. 2 1
      csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs

+ 2 - 1
csharp/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs

@@ -221,7 +221,8 @@ namespace Google.ProtocolBuffers
             Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(),
                 new MessageFormatOptions() { FormattedOutput = true }, "application/json", ms);
 
-            Assert.AreEqual("{\r\n    \"text\": \"a\",\r\n    \"number\": 1\r\n}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length));
+            string expected = string.Format("{{{0}    \"text\": \"a\",{0}    \"number\": 1{0}}}", System.Environment.NewLine);
+            Assert.AreEqual(expected, Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length));
         }
 
         [Test]