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

Commit

Permalink
normalize line endings in xslt tests (#20517)
Browse files Browse the repository at this point in the history
  • Loading branch information
krwq committed Jun 1, 2017
1 parent dd68518 commit 62acd6c
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -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);
Expand All @@ -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))
{
Expand Down

0 comments on commit 62acd6c

Please sign in to comment.