97 references to WithFeature
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\ForeachTest.cs (1)
1683
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (8)
Attributes\AttributeTests_Nullable.cs (4)
3473
AssertNullableAttributes(CreateCompilation(source, options: options, parseOptions: parseOptions.
WithFeature
("nullablePublicOnly")), expectedPublicOnly);
3475
AssertNullableAttributes(CreateCompilation(new[] { source, sourceIVTs }, options: options, parseOptions: parseOptions.
WithFeature
("nullablePublicOnly")), expectedPublicAndInternal);
3590
comp = CreateCompilation(new[] { sourceAttribute, source }, options: options, parseOptions: parseOptions.
WithFeature
("nullablePublicOnly"));
3649
comp = CreateCompilation(new[] { sourceAttribute, source }, options: options, parseOptions: parseOptions.
WithFeature
("nullablePublicOnly"));
Semantics\PrimaryConstructorTests.cs (2)
6827
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
6853
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
Semantics\RecordTests.cs (2)
30366
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
30390
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
EndToEndTests.cs (1)
677
var verifier = CompileAndVerify(files.ToArrayAndFree(), parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global"), expectedOutput: makeExpectedOutput());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (79)
Semantics\InterceptorsTests.cs (32)
36
private static readonly CSharpParseOptions RegularWithInterceptors = TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global");
70
comp = CreateCompilation(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview-experimental"));
73
comp = CreateCompilation(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview", "false"));
76
comp = CreateCompilation(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("interceptorspreview"));
79
comp = CreateCompilation(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview", "Global"));
82
comp = CreateCompilation(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview", "global.a"));
113
var comp = CreateCompilation(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS"));
119
comp = CreateCompilation(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1.NS2"));
125
var verifier = CompileAndVerify(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1"), expectedOutput: "1");
128
verifier = CompileAndVerify(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1;NS2"), expectedOutput: "1");
135
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS"), expectedOutput: null,
140
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1.NS2"), expectedOutput: null,
145
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1"), expectedOutput: "1");
147
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1;NS2"), expectedOutput: "1");
240
var comp = CreateCompilation(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", featureValue));
249
var verifier = CompileAndVerify(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", featureValue), expectedOutput: "1");
275
var comp = CreateCompilation(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", ""));
306
var verifier = CompileAndVerify(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global"), expectedOutput: "1");
309
verifier = CompileAndVerify(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global"), expectedOutput: "1");
337
var comp = CreateCompilation(new[] { (source, "Program.cs"), s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global.A"));
6305
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6350
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6403
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6452
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6508
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6556
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6602
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: featureExists ? TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "") : TestOptions.Regular);
6646
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors;Interceptors"));
6674
var comp = CreateCompilation(new[] { source, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6693
var comp = CreateCompilation([], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6733
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", @namespace));
6775
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors.Nested"));
Semantics\LocalFunctionTests.cs (3)
2369
var comp = CreateCompilation(src, options: TestOptions.UnsafeDebugDll, parseOptions: TestOptions.Regular12.
WithFeature
("run-nullable-analysis", "never"));
2441
CreateCompilation(src, options: TestOptions.UnsafeDebugDll, parseOptions: TestOptions.Regular13.
WithFeature
("run-nullable-analysis", "never")).VerifyDiagnostics(expectedDiagnostics);
2442
CreateCompilation(src, options: TestOptions.UnsafeDebugDll, parseOptions: TestOptions.RegularPreview.
WithFeature
("run-nullable-analysis", "never")).VerifyDiagnostics(expectedDiagnostics);
Semantics\NullableContextTests.cs (23)
185
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", null), expectedAnalyzedKeysDefault);
186
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), expectedAnalyzedKeysAll);
187
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"));
188
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "ALWAYS"), expectedAnalyzedKeysDefault); // unrecognized value (incorrect case) ignored
189
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "NEVER"), expectedAnalyzedKeysDefault); // unrecognized value (incorrect case) ignored
190
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "true"), expectedAnalyzedKeysDefault); // unrecognized value ignored
191
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "false"), expectedAnalyzedKeysDefault); // unrecognized value ignored
192
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "unknown"), expectedAnalyzedKeysDefault); // unrecognized value ignored
239
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", null), expectedAnalyzedKeysDefault);
240
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), expectedAnalyzedKeysAll);
241
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"));
298
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", null), expectedAnalyzedKeysDefault);
299
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), expectedAnalyzedKeysAll);
300
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"));
340
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", null), expectedFlowState: true, expectedAnalyzedKeysAll);
341
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), expectedFlowState: true, expectedAnalyzedKeysAll);
342
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"), expectedFlowState: false);
379
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", null), expectedFlowState: true, expectedAnalyzedKeysAll);
380
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), expectedFlowState: true, expectedAnalyzedKeysAll);
381
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"), expectedFlowState: false);
414
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", null), expectedFlowState: true, expectedAnalyzedKeysAll);
415
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), expectedFlowState: true, expectedAnalyzedKeysAll);
416
verify(parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"), expectedFlowState: false);
Semantics\NullableReferenceTypesTests.cs (11)
5239
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: TestOptions.DebugDll);
5285
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.Disable));
5331
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.Enable));
10611
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: WithNullableEnable());
10770
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: WithNullableEnable());
10933
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: WithNullableEnable());
11123
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: WithNullableEnable());
71775
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: WithNullableEnable());
81153
parseOptions: TestOptions.Regular8.
WithFeature
("staticNullChecking"));
81164
parseOptions: TestOptions.Regular8.
WithFeature
("staticNullChecking", "0"));
81175
parseOptions: TestOptions.Regular8.
WithFeature
("staticNullChecking", "1"));
Semantics\RefFieldTests.cs (8)
8328
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.
WithFeature
("peverify-compat"), targetFramework: TargetFramework.Net70);
13432
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
13496
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
13572
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
13643
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
15125
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
27396
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
27456
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
Semantics\UsingStatementTests.cs (1)
1848
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"));
SourceGeneration\GeneratorDriverTests.cs (1)
4149
var parseOptions = TestOptions.RegularPreview.
WithFeature
("InterceptorsNamespaces", "global");
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Symbols\Source\NullablePublicAPITests.cs (4)
1737
var featureFlagOff = TestOptions.Regular8.
WithFeature
("run-nullable-analysis", "never");
2623
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular8.
WithFeature
("run-nullable-analysis", flagState));
5184
var comp = CreateCompilation(source, parseOptions: runNullableAnalysisAlways ? TestOptions.RegularPreview.
WithFeature
("run-nullable-analysis", "always") : TestOptions.RegularPreview);
5222
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.
WithFeature
("run-nullable-analysis", "never"));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
TestOptions.cs (4)
48
public static readonly CSharpParseOptions RegularWithLegacyStrongName = Regular.
WithFeature
("UseLegacyStrongNameProvider");
133
return options.
WithFeature
("nullablePublicOnly");
138
return options.
WithFeature
("noRefSafetyRulesAttribute");
143
return options.
WithFeature
("disable-length-based-switch");