Skip to content

Commit

Permalink
added ReplaceLineEndings to ensure tests are cross-platform due to li…
Browse files Browse the repository at this point in the history
…ne endings.
  • Loading branch information
Ledjon Behluli authored and Ledjon Behluli committed Nov 29, 2022
1 parent de0421b commit a43b94e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
* text eol=lf

###############################################################################
# Set default behavior for command prompt diff.
Expand Down
9 changes: 7 additions & 2 deletions tests/OrleanSpaces.Analyzers.Tests/FixerFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@ private void TestCodeFix(string code, string fixedCode, Namespace[] namespaces,
fixedCodeBuilder.Append(builder);
fixedCodeBuilder.Append(fixedCode);

newCode = codeBuilder.ToString();
newFixedCode = fixedCodeBuilder.ToString();
newCode = codeBuilder
.ToString()
.ReplaceLineEndings(); // To ensure tests are cross-platform due to line endings.

newFixedCode = fixedCodeBuilder
.ToString()
.ReplaceLineEndings(); // To ensure tests are cross-platform due to line endings.
}

TestCodeFix(newCode, newFixedCode, diagnosticId, selector);
Expand Down

0 comments on commit a43b94e

Please sign in to comment.