Repository navigation
Closed
Labels
area: testinghelpersIssues that address the testing helpersIssues that address the testing helpersstate: ready to pickIssues that are ready for being worked onIssues that are ready for being worked ontype: bugIssues that describe misbehaving functionalityIssues that describe misbehaving functionality
Description
Describe the bug
Not all matches are returned from DirectoryInfo.EnumerateFileSystemInfo. It looks like that the RecurseSubdirectories is ignored.
To Reproduce
[Test]
public void Delete_Me()
{
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>()
{
{ @"c:\bla.txt", null },
{ @"c:\Test\test.txt", null },
{ @"c:\Test\more-test.png", null },
{ @"c:\Test\A\deep-nested.png", null },
});
var path = @"C:\";
var searchPattern = "*";
var enumerateFileSystemEntries = fileSystem.Directory
.EnumerateFileSystemEntries(path, searchPattern, SearchOption.AllDirectories)
.OrderBy(r => r);
var directoryInfo = fileSystem.DirectoryInfo.FromDirectoryName(path);
var fileSystemInfos = directoryInfo.EnumerateFileSystemInfos(searchPattern, new EnumerationOptions()
{
MatchType = MatchType.Win32,
RecurseSubdirectories = true,
IgnoreInaccessible = true,
ReturnSpecialDirectories = false,
AttributesToSkip = FileAttributes.Hidden,
MatchCasing = MatchCasing.PlatformDefault,
})
.Select(r => r.FullName);
CollectionAssert.AreEquivalent(enumerateFileSystemEntries, fileSystemInfos);
}
Expected: equivalent to < "c:\bla.txt", "C:\temp", "c:\Test", "c:\Test\A", "c:\Test\A\deep-nested.png", "c:\Test\more-test.png", "c:\Test\test.txt" >
But was: < "c:\Test", "C:\temp", "c:\bla.txt" >
Missing (4): < "c:\Test\A", "c:\Test\A\deep-nested.png", "c:\Test\more-test.png", "c:\Test\test.txt" >
Expected behavior
I would expect that EnumerateFileSystemEntries and EnumerateFileSystemInfos resulted in the same list. It is doing that for the .net core implementation.
Metadata
Metadata
Assignees
Labels
area: testinghelpersIssues that address the testing helpersIssues that address the testing helpersstate: ready to pickIssues that are ready for being worked onIssues that are ready for being worked ontype: bugIssues that describe misbehaving functionalityIssues that describe misbehaving functionality
Activity
issue-label-bot commentedon Oct 9, 2020
Issue-Label Bot is automatically applying the label
type: bugto this issue, with a confidence of 0.91. Please mark this comment with 👍 or 👎 to give our bot feedback!Links: app homepage, dashboard and code for this bot.
fgreinacher commentedon Oct 12, 2020
Fixed via #652