Skip to content

Commit f4413c6

Browse files
Copilottarekgh
andcommitted
Add test for deeply mixed Combine/Join nesting case
Co-authored-by: tarekgh <[email protected]>
1 parent 4d6cc26 commit f4413c6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Microsoft.CodeAnalysis.NetAnalyzers/tests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests/Microsoft.NetCore.Analyzers/Performance/CollapseMultiplePathOperationsTests.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,23 @@ public void M()
380380
string path = Path.Combine(Path.Join(Path.Combine(""a"", ""b""), ""c""), ""d"");
381381
}
382382
}
383+
";
384+
await VerifyCS.VerifyAnalyzerAsync(csCode);
385+
}
386+
387+
[Fact]
388+
public async Task NoDiagnostic_DeeplyMixedCombineAndJoinNesting()
389+
{
390+
var csCode = @"
391+
using System.IO;
392+
393+
public class Test
394+
{
395+
public void M()
396+
{
397+
string path = Path.Combine(Path.Join(Path.Combine(Path.Combine(""a"", ""b""), ""c""), ""d""), ""e"");
398+
}
399+
}
383400
";
384401
await VerifyCS.VerifyAnalyzerAsync(csCode);
385402
}

0 commit comments

Comments
 (0)