Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ladipro committed Jun 7, 2021
1 parent 485361d commit 056d564
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/Shared/UnitTests/FileMatcher_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public class GetFilesComplexGlobbingMatchingInfo
@"src\bar.cs",
@"src\baz.cs",
@"src\foo\foo.cs",
@"src\foo\licence",
@"src\bar\bar.cs",
@"src\baz\baz.cs",
@"src\foo\inner\foo.cs",
Expand Down Expand Up @@ -368,7 +369,8 @@ public static IEnumerable<object[]> GetTestData()
ExpectedMatches = new[]
{
@"readme.txt",
@"licence"
@"licence",
@"src\foo\licence",
}
}
};
Expand Down Expand Up @@ -422,6 +424,29 @@ public static IEnumerable<object[]> GetTestData()
}
};

// Regression test for https://github.com/Microsoft/msbuild/issues/6502
yield return new object[]
{
new GetFilesComplexGlobbingMatchingInfo
{
Include = @"src\**",
Excludes = new[]
{
@"**\foo\**",
},
ExpectedMatches = new[]
{
@"src\foo.cs",
@"src\bar.cs",
@"src\baz.cs",
@"src\bar\bar.cs",
@"src\baz\baz.cs",
@"src\bar\inner\baz.cs",
@"src\bar\inner\baz\baz.cs",
},
}
};

// Hits the early elimination of exclude file patterns that do not intersect with the include.
// The exclude is redundant and can be eliminated before starting the file system walk.
yield return new object[]
Expand Down

0 comments on commit 056d564

Please sign in to comment.