From cdcd6197de20a709090f6278ab6ccb7a48f68a99 Mon Sep 17 00:00:00 2001 From: Konrad Jamrozik Date: Tue, 10 Jan 2023 18:57:09 -0800 Subject: [PATCH] add CODEOWNERS matcher tests for "/" and file names with spaces (#5090) https://github.com/Azure/azure-sdk-tools/pull/5090 --- .../CodeOwnersFileTests.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/code-owners-parser/Azure.Sdk.Tools.CodeOwnersParser.Tests/CodeOwnersFileTests.cs b/tools/code-owners-parser/Azure.Sdk.Tools.CodeOwnersParser.Tests/CodeOwnersFileTests.cs index 46eac380324..53e83978ffc 100644 --- a/tools/code-owners-parser/Azure.Sdk.Tools.CodeOwnersParser.Tests/CodeOwnersFileTests.cs +++ b/tools/code-owners-parser/Azure.Sdk.Tools.CodeOwnersParser.Tests/CodeOwnersFileTests.cs @@ -26,6 +26,12 @@ public class CodeOwnersFileTests // @formatter:off // Path: Expected match: // Codeowners , Target , Legacy , New + new( "/" , "a" , true , true ), + new( "/" , "A" , true , true ), + new( "/" , "/a" , true , true ), + new( "/" , "a/" , true , true ), + new( "/" , "/a/" , true , true ), + new( "/" , "/a/b" , true , true ), new( "/a" , "a" , true , true ), new( "/a" , "A" , true , false ), new( "/a" , "/a" , true , true ), @@ -33,6 +39,7 @@ public class CodeOwnersFileTests new( "/a" , "/a/" , true , false ), new( "/a" , "/a/b" , true , false ), new( "/a" , "/a/b/" , true , false ), + new( "/a" , "/a\\ b" , true , false ), new( "/a" , "/x/a/b" , false , false ), new( "a" , "a" , true , true ), new( "a" , "A" , true , false ), @@ -47,6 +54,7 @@ public class CodeOwnersFileTests new( "/a/" , "a/" , true , true ), new( "/a/" , "/a/" , true , true ), new( "/a/" , "/a/b" , true , true ), + new( "/a/" , "/a\\ b" , true , true ), new( "/a/" , "/a/b/" , true , true ), new( "/a/" , "/A/b/" , true , false ), new( "/a/" , "/x/a/b" , false , false ),