Fix enumerating the root directory. (dotnet/corefx#27223)
authorJeremy Kuhne <jeremy.kuhne@microsoft.com>
Sat, 17 Feb 2018 05:52:07 +0000 (21:52 -0800)
committerGitHub <noreply@github.com>
Sat, 17 Feb 2018 05:52:07 +0000 (21:52 -0800)
commit1db4e20423938ba7e08d0998cf1e7c2a2cc7892a
treef0b1aeddf403a75927ac102166f355b5f2e04749
parent62dab49536666849f4db0d87364cc5353fef255f
Fix enumerating the root directory. (dotnet/corefx#27223)

* Fix enumerating the root directory.

Shouldn't trim the trailing separator when at the root. On Windows that makes
the path drive relative- which breaks most of the logic.

Add a test to catch this case.

* Add the Unix part of the fix.

Commit migrated from https://github.com/dotnet/corefx/commit/5b4ce203c563a20053f32f9901ea6b7dc67c8e37
src/libraries/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerator.Unix.cs
src/libraries/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerator.Windows.cs
src/libraries/System.IO.FileSystem/tests/Enumeration/RootTests.netcoreapp.cs [new file with mode: 0644]
src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj