PathVerifier fails on whitespace filename under Linux and .NET Core #1070
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
Describe the bug
When using
FileSystem
andMockFileSystem
I noticed there is different behavior when creating a newIFileInfo
using only whitespaces.The "error" trails down to the PathVerifier that the
MockFileSystem
usesTo Reproduce
Expected behavior
(whitespace) is a valid file name
Both calls throw an exception when they should not.
For Linux
For Windows and Linux
\u00A0
is a valid file name. However under .NET Framework it also failsAdditional context
In
PathInternal.OS.cs
.NET has abool IsEffectivelyEmpty(string? path)
method which behaves differently to linux and windows, just to cover those cases.Currently
PathVerifier
uses thestring.Trim()
method, which causes the two explained scenarios\u00A0
)The text was updated successfully, but these errors were encountered: