58 references to WithFeature
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
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"));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (48)
Semantics\LocalFunctionTests.cs (1)
2369
var comp = CreateCompilation(src, options: TestOptions.UnsafeDebugDll, parseOptions: TestOptions.RegularNext.
WithFeature
("run-nullable-analysis", "never"));
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)
5227
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: TestOptions.DebugDll);
5273
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.Disable));
5319
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.Enable));
10599
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: WithNullableEnable());
10758
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: WithNullableEnable());
10921
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: WithNullableEnable());
11111
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: WithNullableEnable());
68358
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "always"), options: WithNullableEnable());
77506
parseOptions: TestOptions.Regular8.
WithFeature
("staticNullChecking"));
77517
parseOptions: TestOptions.Regular8.
WithFeature
("staticNullChecking", "0"));
77528
parseOptions: TestOptions.Regular8.
WithFeature
("staticNullChecking", "1"));
Semantics\PrimaryConstructorTests.cs (2)
6212
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
6238
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
Semantics\RecordTests.cs (2)
30345
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
30369
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"), targetFramework: TargetFramework.NetCoreApp);
Semantics\RefFieldTests.cs (8)
7888
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.
WithFeature
("peverify-compat"), targetFramework: TargetFramework.Net70);
12939
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
13003
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
13079
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
13150
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
14632
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
26641
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
26701
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.
WithFeature
("run-nullable-analysis", "never"));
Semantics\UsingStatementTests.cs (1)
1847
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.
WithFeature
("run-nullable-analysis", "never"));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\Source\NullablePublicAPITests.cs (2)
1738
var featureFlagOff = TestOptions.Regular8.
WithFeature
("run-nullable-analysis", "never");
2624
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular8.
WithFeature
("run-nullable-analysis", flagState));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
TestOptions.cs (4)
44
public static readonly CSharpParseOptions RegularWithLegacyStrongName = Regular.
WithFeature
("UseLegacyStrongNameProvider");
127
return options.
WithFeature
("nullablePublicOnly");
132
return options.
WithFeature
("noRefSafetyRulesAttribute");
137
return options.
WithFeature
("disable-length-based-switch");