diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCaseBase.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCaseBase.cs index 9614e46c0c82..2a71fd80f8d6 100644 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCaseBase.cs +++ b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCaseBase.cs @@ -73,6 +73,11 @@ protected static void CompareOutput(string expected, Stream actualStream) } } + private static string NormalizeLineEndings(string s) + { + return s.Replace("\r\n", "\n").Replace("\r", "\n"); + } + protected static void CompareOutput(Stream expectedStream, Stream actualStream, int count = 0) { actualStream.Seek(0, SeekOrigin.Begin); @@ -86,8 +91,8 @@ protected static void CompareOutput(Stream expectedStream, Stream actualStream, expectedReader.ReadLine(); } - string actual = actualReader.ReadToEnd(); - string expected = expectedReader.ReadToEnd(); + string actual = NormalizeLineEndings(actualReader.ReadToEnd()); + string expected = NormalizeLineEndings(expectedReader.ReadToEnd()); if (actual.Equals(expected)) {