Skip to content

Commit 0196341

Browse files
author
msftbot[bot]
authored
Merge pull request #45762 from CyrusNajmabadi/enableTests2
Enable tests and update features to support new language changes around patterns.
2 parents e2ed258 + 7305d23 commit 0196341

File tree

4 files changed

+54
-148
lines changed

4 files changed

+54
-148
lines changed

src/EditorFeatures/CSharpTest/Completion/CompletionProviders/PropertySubPatternCompletionProviderTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ class D
503503
public int P2 { get; set; }
504504
}
505505
";
506-
await VerifyNoItemsExistAsync(markup);
506+
await VerifyItemExistsAsync(markup, "P1");
507507
}
508508

509509
[Fact]
@@ -528,7 +528,7 @@ class D
528528
await VerifyNoItemsExistAsync(markup);
529529
}
530530

531-
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/40015")]
531+
[Fact]
532532
public async Task PropertiesInRecursivePattern_InPositional_Incomplete()
533533
{
534534
var markup =
@@ -539,16 +539,16 @@ public class Program
539539
540540
void M()
541541
{
542-
_ = this is ({ $$ }) // no deconstruction into 1 element
542+
_ = this is ({ $$ }) // Can deconstruct into a parenthesized property pattern
543543
}
544544
545545
public void Deconstruct(out Program x, out Program y) => throw null;
546546
}
547547
";
548-
await VerifyNoItemsExistAsync(markup);
548+
await VerifyItemExistsAsync(markup, "P1", displayTextSuffix: ":");
549549
}
550550

551-
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/40015")]
551+
[Fact]
552552
public async Task PropertiesInRecursivePattern_InPositional_Incomplete_WithoutClosingBrace()
553553
{
554554
var markup =
@@ -559,13 +559,13 @@ public class Program
559559
560560
void M()
561561
{
562-
_ = this is ({ $$ // no deconstruction into 1 element
562+
_ = this is ({ $$ // Can deconstruct into a parenthesized property pattern
563563
}
564564
565565
public void Deconstruct(out Program x, out Program y) => throw null;
566566
}
567567
";
568-
await VerifyNoItemsExistAsync(markup);
568+
await VerifyItemExistsAsync(markup, "P1", displayTextSuffix: ":");
569569
}
570570

571571
[Fact]

src/EditorFeatures/CSharpTest2/Recommendations/WhenKeywordRecommenderTests.cs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -193,33 +193,33 @@ public async Task TestForSwitchCase_NotAfterColon_BeforeBreak() =>
193193
public async Task TestForSwitchCase_NotInEmptySwitchStatement() =>
194194
await VerifyAbsenceAsync(AddInsideMethod(@"switch (1) { $$ }"));
195195

196-
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/40015"), Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
196+
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
197197
public async Task TestForSwitchCase_SemanticCheck_NotAfterPredefinedType() =>
198-
await VerifyAbsenceAsync(AddInsideMethod(@"switch (new object()) { case int $$ }"));
198+
await VerifyKeywordAsync(AddInsideMethod(@"switch (new object()) { case int $$ }"));
199199

200-
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/40015"), Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
200+
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
201201
public async Task TestForSwitchCase_SemanticCheck_NotAfterPredefinedType_BeforeBreak() =>
202-
await VerifyAbsenceAsync(AddInsideMethod(@"switch (new object()) { case int $$ break; }"));
202+
await VerifyKeywordAsync(AddInsideMethod(@"switch (new object()) { case int $$ break; }"));
203203

204-
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/40015"), Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
204+
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
205205
public async Task TestForSwitchCase_SemanticCheck_NotAfterPredefinedType_BeforeWhen() =>
206-
await VerifyAbsenceAsync(AddInsideMethod(@"switch (new object()) { case int $$ when }"));
206+
await VerifyKeywordAsync(AddInsideMethod(@"switch (new object()) { case int $$ when }"));
207207

208-
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/40015"), Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
208+
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
209209
public async Task TestForSwitchCase_SemanticCheck_NotAfterGenericType() =>
210-
await VerifyAbsenceAsync(AddInsideMethod(@"switch (new object()) { case Dictionary<string, int> $$ }"));
210+
await VerifyKeywordAsync(AddInsideMethod(@"switch (new object()) { case Dictionary<string, int> $$ }"));
211211

212-
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/40015"), Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
212+
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
213213
public async Task TestForSwitchCase_SemanticCheck_NotAfterGenericType_BeforeBreak() =>
214-
await VerifyAbsenceAsync(AddInsideMethod(@"switch (new object()) { case Dictionary<string, int> $$ break; }"));
214+
await VerifyKeywordAsync(AddInsideMethod(@"switch (new object()) { case Dictionary<string, int> $$ break; }"));
215215

216-
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/40015"), Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
216+
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
217217
public async Task TestForSwitchCase_SemanticCheck_NotAfterGenericType_BeforeWhen() =>
218-
await VerifyAbsenceAsync(AddInsideMethod(@"switch (new object()) { case Dictionary<string, int> $$ when }"));
218+
await VerifyKeywordAsync(AddInsideMethod(@"switch (new object()) { case Dictionary<string, int> $$ when }"));
219219

220220
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
221221
public async Task TestForSwitchCase_SemanticCheck_NotAfterCustomType() =>
222-
await VerifyAbsenceAsync(@"
222+
await VerifyKeywordAsync(@"
223223
class SyntaxNode { }
224224
class C
225225
{
@@ -228,7 +228,7 @@ class C
228228

229229
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
230230
public async Task TestForSwitchCase_SemanticCheck_NotAfterCustomType_BeforeBreak() =>
231-
await VerifyAbsenceAsync(@"
231+
await VerifyKeywordAsync(@"
232232
class SyntaxNode { }
233233
class C
234234
{
@@ -237,7 +237,7 @@ class C
237237

238238
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
239239
public async Task TestForSwitchCase_SemanticCheck_NotAfterCustomType_BeforeWhen() =>
240-
await VerifyAbsenceAsync(@"
240+
await VerifyKeywordAsync(@"
241241
class SyntaxNode { }
242242
class C
243243
{
@@ -246,7 +246,7 @@ class C
246246

247247
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
248248
public async Task TestForSwitchCase_SemanticCheck_NotAfterTypeAlias() =>
249-
await VerifyAbsenceAsync(@"
249+
await VerifyKeywordAsync(@"
250250
using Type = System.String;
251251
class C
252252
{
@@ -255,7 +255,7 @@ class C
255255

256256
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
257257
public async Task TestForSwitchCase_SemanticCheck_NotAfterTypeAlias_BeforeBreak() =>
258-
await VerifyAbsenceAsync(@"
258+
await VerifyKeywordAsync(@"
259259
using Type = System.String;
260260
class C
261261
{
@@ -264,7 +264,7 @@ class C
264264

265265
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
266266
public async Task TestForSwitchCase_SemanticCheck_NotAfterTypeAlias_BeforeWhen() =>
267-
await VerifyAbsenceAsync(@"
267+
await VerifyKeywordAsync(@"
268268
using Type = System.String;
269269
class C
270270
{
@@ -273,7 +273,7 @@ class C
273273

274274
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
275275
public async Task TestForSwitchCase_SemanticCheck_NotAfterOverloadedTypeName() =>
276-
await VerifyAbsenceAsync(@"
276+
await VerifyKeywordAsync(@"
277277
class ValueTuple { }
278278
class ValueTuple<T> { }
279279
class C
@@ -283,7 +283,7 @@ class C
283283

284284
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
285285
public async Task TestForSwitchCase_SemanticCheck_NotAfterOverloadedTypeName_BeforeBreak() =>
286-
await VerifyAbsenceAsync(@"
286+
await VerifyKeywordAsync(@"
287287
class ValueTuple { }
288288
class ValueTuple<T> { }
289289
class C
@@ -293,7 +293,7 @@ class C
293293

294294
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
295295
public async Task TestForSwitchCase_SemanticCheck_NotAfterOverloadedTypeName_BeforeWhen() =>
296-
await VerifyAbsenceAsync(@"
296+
await VerifyKeywordAsync(@"
297297
class ValueTuple { }
298298
class ValueTuple<T> { }
299299
class C
@@ -462,19 +462,19 @@ class C
462462

463463
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
464464
public async Task TestForSwitchCase_SemanticCheck_AfterLocalConstantVar() =>
465-
await VerifyKeywordAsync(AddInsideMethod(@"const object var = null; switch (new object()) { case var $$ }"));
465+
await VerifyAbsenceAsync(AddInsideMethod(@"const object var = null; switch (new object()) { case var $$ }"));
466466

467467
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
468468
public async Task TestForSwitchCase_SemanticCheck_AfterLocalConstantVar_BeforeBreak() =>
469-
await VerifyKeywordAsync(AddInsideMethod(@"const object var = null; switch (new object()) { case var $$ break; }"));
469+
await VerifyAbsenceAsync(AddInsideMethod(@"const object var = null; switch (new object()) { case var $$ break; }"));
470470

471471
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
472472
public async Task TestForSwitchCase_SemanticCheck_AfterLocalConstantVar_BeforeWhen() =>
473-
await VerifyKeywordAsync(AddInsideMethod(@"const object var = null; switch (new object()) { case var $$ when }"));
473+
await VerifyAbsenceAsync(AddInsideMethod(@"const object var = null; switch (new object()) { case var $$ when }"));
474474

475475
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
476476
public async Task TestForSwitchCase_SemanticCheck_AfterClassAndLocalConstantVar() =>
477-
await VerifyKeywordAsync(@"
477+
await VerifyAbsenceAsync(@"
478478
class var { }
479479
class C
480480
{
@@ -483,7 +483,7 @@ class C
483483

484484
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
485485
public async Task TestForSwitchCase_SemanticCheck_AfterClassAndLocalConstantVar_BeforeBreak() =>
486-
await VerifyKeywordAsync(@"
486+
await VerifyAbsenceAsync(@"
487487
class var { }
488488
class C
489489
{
@@ -492,7 +492,7 @@ class C
492492

493493
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
494494
public async Task TestForSwitchCase_SemanticCheck_AfterClassAndLocalConstantVar_BeforeWhen() =>
495-
await VerifyKeywordAsync(@"
495+
await VerifyAbsenceAsync(@"
496496
class var { }
497497
class C
498498
{
@@ -502,7 +502,7 @@ class C
502502
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
503503
public async Task TestForSwitchCase_SemanticCheck_AfterTypeAliasAndFieldConstantVar()
504504
{
505-
await VerifyKeywordAsync(@"
505+
await VerifyAbsenceAsync(@"
506506
using var = System.String;
507507
class C
508508
{
@@ -514,7 +514,7 @@ class C
514514
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
515515
public async Task TestForSwitchCase_SemanticCheck_AfterTypeAliasAndFieldConstantVar_BeforeBreak()
516516
{
517-
await VerifyKeywordAsync(@"
517+
await VerifyAbsenceAsync(@"
518518
using var = System.String;
519519
class C
520520
{
@@ -526,7 +526,7 @@ class C
526526
[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
527527
public async Task TestForSwitchCase_SemanticCheck_AfterTypeAliasAndFieldConstantVar_BeforeWhen()
528528
{
529-
await VerifyKeywordAsync(@"
529+
await VerifyAbsenceAsync(@"
530530
using var = System.String;
531531
class C
532532
{

src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5223,7 +5223,7 @@ class C
52235223

52245224
state.SendBackspace()
52255225
state.SendTypeChars("w")
5226-
Await state.AssertSelectedCompletionItem(displayText:="with", isHardSelected:=False)
5226+
Await state.AssertSelectedCompletionItem(displayText:="when", isHardSelected:=False)
52275227

52285228
End Using
52295229
End Function

0 commit comments

Comments
 (0)