Skip to content

Commit f31e665

Browse files
Add test for parenthesized patterns without comma separation
Co-authored-by: CyrusNajmabadi <4564579+CyrusNajmabadi@users.noreply.github.com>
1 parent 2dc9d9a commit f31e665

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

src/Workspaces/CSharpTest/Formatting/FormattingTests_Patterns.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,4 +654,46 @@ void M(object former, object latter)
654654
}
655655
}
656656
""");
657+
658+
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/54434")]
659+
public Task FormatPropertyPatternInParenthesizedPattern1()
660+
=> AssertFormatAsync("""
661+
class C
662+
{
663+
void M(object value)
664+
{
665+
if (
666+
value is not (
667+
{
668+
Expression: IdentifierNameSyntax
669+
{
670+
Identifier: { ValueText: var identifier }
671+
}
672+
}
673+
)
674+
)
675+
{
676+
}
677+
}
678+
}
679+
""", """
680+
class C
681+
{
682+
void M(object value)
683+
{
684+
if (
685+
value is not (
686+
{
687+
Expression: IdentifierNameSyntax
688+
{
689+
Identifier: { ValueText: var identifier }
690+
}
691+
}
692+
)
693+
)
694+
{
695+
}
696+
}
697+
}
698+
""");
657699
}

0 commit comments

Comments
 (0)