Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 62acd6c

Browse files
committed
normalize line endings in xslt tests (#20517)
1 parent dd68518 commit 62acd6c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCaseBase.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ protected static void CompareOutput(string expected, Stream actualStream)
7373
}
7474
}
7575

76+
private static string NormalizeLineEndings(string s)
77+
{
78+
return s.Replace("\r\n", "\n").Replace("\r", "\n");
79+
}
80+
7681
protected static void CompareOutput(Stream expectedStream, Stream actualStream, int count = 0)
7782
{
7883
actualStream.Seek(0, SeekOrigin.Begin);
@@ -86,8 +91,8 @@ protected static void CompareOutput(Stream expectedStream, Stream actualStream,
8691
expectedReader.ReadLine();
8792
}
8893

89-
string actual = actualReader.ReadToEnd();
90-
string expected = expectedReader.ReadToEnd();
94+
string actual = NormalizeLineEndings(actualReader.ReadToEnd());
95+
string expected = NormalizeLineEndings(expectedReader.ReadToEnd());
9196

9297
if (actual.Equals(expected))
9398
{

0 commit comments

Comments
 (0)