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

Update so that SA1600 tests will be run with the expected language version in test projects for c# 8 and above #3614

Merged
Merged
Show file tree
Hide file tree
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 @@ -22,9 +22,6 @@ protected override DiagnosticResult[] GetExpectedResultTestRegressionMethodGloba
// /0/Test0.cs(4,1): error CS0106: The modifier 'public' is not valid for this item
DiagnosticResult.CompilerError("CS0106").WithSpan(4, 1, 4, 7).WithArguments("public"),

// /0/Test0.cs(4,1): error CS8320: Feature 'top-level statements' is not available in C# 7.2. Please use language version 9.0 or greater.
DiagnosticResult.CompilerError("CS8320").WithSpan(4, 1, 4, 29).WithArguments("top-level statements", "9.0"),

// /0/Test0.cs(4,1): error CS8805: Program using top-level statements must be an executable.
DiagnosticResult.CompilerError("CS8805").WithSpan(4, 1, 4, 29),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

namespace StyleCop.Analyzers.Test.CSharp8.DocumentationRules
{
using Microsoft.CodeAnalysis.CSharp;
using StyleCop.Analyzers.Test.CSharp7.DocumentationRules;

public class SA1600CSharp8UnitTests : SA1600CSharp7UnitTests
{
// Using 'Default' here makes sure that later test projects also run these tests with their own language version, without having to override this property
protected override LanguageVersion LanguageVersion => LanguageVersion.Default;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ protected override DiagnosticResult[] GetExpectedResultTestRegressionMethodGloba

// /0/Test0.cs(4,1): error CS0106: The modifier 'public' is not valid for this item
DiagnosticResult.CompilerError("CS0106").WithSpan(4, 1, 4, 7).WithArguments("public"),

// /0/Test0.cs(4,1): error CS8320: Feature 'top-level statements' is not available in C# 7.2. Please use language version 9.0 or greater.
DiagnosticResult.CompilerError("CS8320").WithSpan(4, 1, 4, 29).WithArguments("top-level statements", "9.0"),
};
}

Expand Down