Skip to content
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

Added support for multiple analyzers to the test verifiers #802

Merged
merged 5 commits into from
May 17, 2015

Conversation

vweijsters
Copy link
Contributor

Added support to the test verifiers to run multiple analyzers in a single test case. This will be helpful when testing code fix verifiers that can handle multiple rules.

My intention is to use this in #650

@vweijsters
Copy link
Contributor Author

Updated to work with #841

/// <param name="cancellationToken">The <see cref="CancellationToken"/> that the task will observe.</param>
/// <returns>A collection of <see cref="Diagnostic"/>s that surfaced in the source code, sorted by
/// <see cref="Diagnostic.Location"/>.</returns>
private static Task<ImmutableArray<Diagnostic>> GetSortedDiagnosticsAsync(string[] sources, string language, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken)
private static Task<ImmutableArray<Diagnostic>> GetSortedDiagnosticsAsync(string[] sources, string language, DiagnosticAnalyzer[] analyzers, CancellationToken cancellationToken)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗ Lets use ImmutableArray<DiagnosticAnalyzer> analyzers instead of DiagnosticAnalyzer[].

@vweijsters
Copy link
Contributor Author

Updated with CR comments

@sharwell sharwell added this to the 1.0.0 Alpha 7 milestone May 17, 2015
@sharwell sharwell self-assigned this May 17, 2015
{
var diagnostics = await GetSortedDiagnosticsAsync(sources, language, analyzer, cancellationToken).ConfigureAwait(false);
VerifyDiagnosticResults(diagnostics, analyzer, expected);
var diagnostics = await GetSortedDiagnosticsAsync(sources, language, analyzers.ToImmutableArray(), cancellationToken).ConfigureAwait(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 The call to ToImmutableArray() is unnecessary here (I removed it when I merged this pull request).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants