提交 8e3ed3b4 编写于 作者: S Sam Harwell

Fix tests since non-warning diagnostics are reported with /warn:0

上级 3f27cc98
......@@ -3995,25 +3995,8 @@ void Main()
options: PreferIntrinsicTypeInMemberAccess);
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsSimplifyTypeNames)]
[WorkItem(20377, "https://github.com/dotnet/roslyn/issues/20377")]
public async Task TestWarningLevel0()
{
// Ideally we would also want features to work with /warn:0, but this causes a compatibility conflict since
// /warn:0 can be used to suppress warnings with /warnaserror enabled.
await TestMissingInRegularAndScriptAsync(
@"using System;
namespace Root
{
class A
{
[|System.Exception|] c;
}
}", new TestParameters(compilationOptions: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, warningLevel: 0)));
}
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(2)]
[InlineData(3)]
......@@ -4052,6 +4035,10 @@ private async Task TestWithPredefinedTypeOptionsAsync(string code, string expect
SingleOption(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInDeclaration, true, NotificationOption.Error),
SingleOption(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, this.onWithError, GetLanguage()));
private IDictionary<OptionKey, object> PreferIntrinsicTypeEverywhereAsWarning => OptionsSet(
SingleOption(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInDeclaration, true, NotificationOption.Warning),
SingleOption(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, this.onWithWarning, GetLanguage()));
private IDictionary<OptionKey, object> PreferIntrinsicTypeInDeclaration => OptionsSet(
SingleOption(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInDeclaration, true, NotificationOption.Error),
SingleOption(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, this.offWithNone, GetLanguage()));
......
......@@ -1354,26 +1354,8 @@ static void Main(string[] args)
}");
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryImports)]
[WorkItem(20377, "https://github.com/dotnet/roslyn/issues/20377")]
public async Task TestWarningLevel0()
{
// Ideally we would also want features to work with /warn:0, but this causes a compatibility conflict since
// /warn:0 can be used to suppress warnings with /warnaserror enabled.
await TestMissingInRegularAndScriptAsync(
@"[|using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main(string[] args)
{
}
}|]", new TestParameters(compilationOptions: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, warningLevel: 0)));
}
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(2)]
[InlineData(3)]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册