Skip to content

Run test on Linux and Mac #45642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,22 +147,25 @@ public static IEnumerable<object[]> FixedWithAppendAddsUsingDirectiveTestData()
};
}

[ConditionalTheory]
[OSSkipCondition(OperatingSystems.Linux)]
[OSSkipCondition(OperatingSystems.MacOSX)]
[Theory]
[MemberData(nameof(FixedWithAppendAddsUsingDirectiveTestData))]
public async Task IHeaderDictionary_WithAdd_FixedWithAppend_AddsUsingDirective(string source, string fixedSource)
{
// Source is cloned on Windows with CRLF line endings, then the test is run by Helix in Windows/Linux/macOS.
// When Roslyn adds a new `using`, it gets added followed by Environment.NewLine.
// For Linux/macOS, the actual result is `\n`, however, the source is cloned on Windows with CRLF expectation.
// We replace all line endings with Environment.NewLine to avoid this.

// Arrange & Act & Assert
await VerifyCS.VerifyCodeFixAsync(
source.TrimStart(),
source.TrimStart().ReplaceLineEndings(),
new[]
{
new DiagnosticResult(DiagnosticDescriptors.DoNotUseIHeaderDictionaryAdd)
.WithLocation(0)
.WithMessage(Resources.Analyzer_HeaderDictionaryAdd_Message)
},
fixedSource.TrimStart(),
fixedSource.TrimStart().ReplaceLineEndings(),
codeActionEquivalenceKey: AppendCodeActionEquivalenceKey);
}

Expand Down