MockDirectory.EnumerateFiles search pattern behaves differently from Directory.EnumerateFiles in .NET 5+ #895
Labels
area: testinghelpers
Issues that address the testing helpers
state: ready to pick
Issues that are ready for being worked on
type: bug
Issues that describe misbehaving functionality
In .NET 5 the behaviour of the file extension search pattern changed from .NET Framework.
See EnumerateFiles, specifically the table entry
book.xls, book.xlsx | *.xls | book.xls | book.xls, book.xlsx
To Reproduce
Steps to reproduce the behaviour:
a.txt
andb.txt2
in a directory.Directory.EnumerateFiles(dir, "*.txt", SearchOption.AllDirectories)
MockDirectory
Expected behaviour
Only
a.txt
should be returned.Actual behaviour
Both
a.txt
andb.txt2
are returned.Can also just use
*.t
as search pattern which should return no files in a folder of.txt
files etc.The text was updated successfully, but these errors were encountered: