[tests] Fix CRLF issues in System.CodeDom tests (#52540)
authorRadek Doulik <radek.doulik@gmail.com>
Wed, 12 May 2021 21:58:03 +0000 (23:58 +0200)
committerGitHub <noreply@github.com>
Wed, 12 May 2021 21:58:03 +0000 (23:58 +0200)
commita20b92eb1e90be53bd5ccfc4d14d45ce89d9830f
treef807bb8b6dac5dfa0142ce00152f9e15874b8697
parentda42d13516a2c55b53f466ec68c8131c82fab1f1
[tests] Fix CRLF issues in System.CodeDom tests (#52540)

Fixes: https://github.com/dotnet/runtime/issues/52107
When running `System.CodeDom` tests on windows and  targeting
`Browser`, the line ending differs between host and target systems.
Add helper `LineEndingsHelper.Normalize` method to update expected
strings.

The `Browser` Environment.NewLine is `\n`, while windows use `\r\n`.
https://github.com/dotnet/runtime/blob/5bd0edfe860e41bdfd690d3743e730594307292e/src/libraries/System.Private.CoreLib/src/System/Environment.UnixOrBrowser.cs#L51
src/libraries/Common/tests/TestUtilities/System/LineEndingsHelper.cs [new file with mode: 0644]
src/libraries/Common/tests/TestUtilities/TestUtilities.csproj
src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CSharpCodeGeneratorTests.cs
src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CodeGenerationTests.cs