119 references to WithFeature
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (24)
CodeGen\ForeachTest.cs (1)
1683
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
Emit\EmitErrorTests.cs (3)
351
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "1000000"))
355
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals"),
360
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "0"),
Emit\EmitMetadataTests.cs (20)
2949
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "0"));
2962
comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "0"));
2975
comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "0"));
2998
comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "1"));
3015
comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "3"));
3054
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", null),
3065
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", feature),
3073
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "1000"),
3080
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "3"),
3087
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "2"),
3107
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "1"),
3127
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "0"),
3154
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "0"),
3186
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "0"),
3287
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", feature),
3312
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "0"),
3354
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "0"),
3400
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "0"),
3437
parseOptions: TestOptions.Regular.
WithFeature
("experimental-data-section-string-literals", "0"),
3484
.
WithFeature
("experimental-data-section-string-literals", "0");
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)
6828
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
6854
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
Semantics\RecordTests.cs (2)
30481
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
30505
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");
120
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview-experimental"));
123
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview", "false"));
126
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("interceptorspreview"));
129
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview", "Global"));
132
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsPreview", "global.a"));
165
var comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS"));
171
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1.NS2"));
177
var verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1"), expectedOutput: "1");
180
verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1;NS2"), expectedOutput: "1");
187
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS"), expectedOutput: null,
192
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1.NS2"), expectedOutput: null,
197
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1"), expectedOutput: "1");
199
test(TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "NS1;NS2"), expectedOutput: "1");
303
var verifier = CompileAndVerify([source, interceptor, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", featureValue), expectedOutput: "1");
331
var comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", ""));
363
var verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global"), expectedOutput: "1");
366
verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global"), expectedOutput: "1");
397
var comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "global.A"));
6825
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6872
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6925
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
6974
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
7030
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
7078
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
7125
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: featureExists ? TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "") : TestOptions.Regular);
7169
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors;Interceptors"));
7197
var comp = CreateCompilation(new[] { source, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
7216
var comp = CreateCompilation([], parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", "Interceptors"));
7256
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.
WithFeature
("InterceptorsNamespaces", @namespace));
7299
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);
13437
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
13501
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
13577
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
13648
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
15130
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
27951
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
28011
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)
4279
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));
5181
var comp = CreateCompilation(source, parseOptions: runNullableAnalysisAlways ? TestOptions.RegularPreview.
WithFeature
("run-nullable-analysis", "always") : TestOptions.RegularPreview);
5219
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");