96 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)
30411
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
30435
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
EndToEndTests.cs (1)
682
var verifier = CompileAndVerify(files.ToArrayAndFree(), parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global"), expectedOutput: makeExpectedOutput());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (78)
Semantics\InterceptorsTests.cs (31)
36
private static readonly CSharpParseOptions RegularWithInterceptors = TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global");
83
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview-experimental"));
86
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview", "false"));
89
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("interceptorspreview"));
92
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview", "Global"));
95
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview", "global.a"));
128
var comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS"));
134
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1.NS2"));
140
var verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1"), expectedOutput: "1");
143
verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1;NS2"), expectedOutput: "1");
150
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS"), expectedOutput: null,
155
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1.NS2"), expectedOutput: null,
160
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1"), expectedOutput: "1");
162
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1;NS2"), expectedOutput: "1");
266
var verifier = CompileAndVerify([source, interceptor, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", featureValue), expectedOutput: "1");
294
var comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", ""));
326
var verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global"), expectedOutput: "1");
329
verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global"), expectedOutput: "1");
360
var comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global.A"));
6788
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6835
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6888
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6937
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6993
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
7041
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
7088
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: featureExists ? TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "") : TestOptions.Regular);
7132
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors;Interceptors"));
7160
var comp = CreateCompilation(new[] { source, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
7179
var comp = CreateCompilation([], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
7219
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", @namespace));
7262
var comp = CreateCompilation([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"));
27959
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
28019
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");