Skip to content

Commit

Permalink
Hack for fixing tests EOL formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
FrediKats committed May 17, 2024
1 parent 9880b2e commit 3989518
Show file tree
Hide file tree
Showing 3 changed files with 8,258 additions and 645 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,22 @@ public void Format_QualityAndStyleRulesMashed_ReturnOrderedLinesWithHeader()
public void FormatAccordingToRuleDefinitions_Sample_ReturnExpectedFormatterDocument()
{
string input = File.ReadAllText(Path.Combine("Resources", "Editor-config-sample.ini"));
string expected = File.ReadAllText(Path.Combine("Resources", "Editor-config-sample-formatted.ini"));
// TODO: Do smth with this =_=
string expected = File.ReadAllText(Path.Combine("Resources", "Editor-config-sample-formatted.ini"))
.Replace("\r\n", "\n")
.Replace("\n", Environment.NewLine);
;
MsLearnDocumentationRawInfo msLearnDocumentationRawInfo = _repositoryPathReader.Provide(Constants.GetPathToMsDocsRoot());
RoslynRules roslynRules = _msLearnDocumentationParser.Parse(msLearnDocumentationRawInfo);

EditorConfigDocument editorConfigDocument = _parser.Parse(input);
EditorConfigDocument formattedDocument = _formatter.FormatAccordingToRuleDefinitions(editorConfigDocument, roslynRules);
formattedDocument.ToFullString().Should().Be(expected);
// TODO: Do smth with this =_=

formattedDocument.ToFullString()
.Replace("\r\n", "\n")
.Replace("\n", Environment.NewLine)
.Should().Be(expected);
}

private void FormatAndCompare(string input, string expected)
Expand Down
Loading

0 comments on commit 3989518

Please sign in to comment.