diff options
author | Marek Safar <marek.safar@gmail.com> | 2018-04-22 01:13:54 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-04-22 01:13:54 +0300 |
commit | 0ade272095cb7a8bf1466dfb5a17d8ab82548ce6 (patch) | |
tree | 70184061a6bd683b4bdd58028736c572211b196f /src/System.IO.FileSystem/tests | |
parent | 0ee9a8af686642e73a4a57c6bb32b0ad439ba37e (diff) | |
parent | 2533ae7ad1fb65ad8bc105b1841ca3f5e18ead72 (diff) |
Merge remote-tracking branch 'upstream/release/2.1'
Diffstat (limited to 'src/System.IO.FileSystem/tests')
-rw-r--r-- | src/System.IO.FileSystem/tests/Directory/Exists.cs | 15 | ||||
-rw-r--r-- | src/System.IO.FileSystem/tests/File/Delete.cs | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/System.IO.FileSystem/tests/Directory/Exists.cs b/src/System.IO.FileSystem/tests/Directory/Exists.cs index d4e80bf9db..1db1170158 100644 --- a/src/System.IO.FileSystem/tests/Directory/Exists.cs +++ b/src/System.IO.FileSystem/tests/Directory/Exists.cs @@ -375,11 +375,24 @@ namespace System.IO.Tests Assert.False(result); } + // Not all drives may be accessible (locked, no rights, etc.), and as such would return false. + // eg. Create a new volume, bitlocker it, and lock it. This new volume is no longer accessible + // and any attempt to access this drive will return false. + // We just care that we can access an accessible drive directly, we don't care which one. [Fact] [PlatformSpecific(TestPlatforms.Windows)] // drive labels - public void NonExistentDriveAsPath_ReturnsFalse() + public void DriveAsPath() { Assert.False(Exists(IOServices.GetNonExistentDrive())); + Assert.Contains(IOServices.GetReadyDrives(), drive => Exists(drive)); + } + + [ConditionalFact(nameof(UsingNewNormalization))] + [PlatformSpecific(TestPlatforms.Windows)] // drive labels + public void ExtendedDriveAsPath() + { + Assert.False(Exists(IOInputs.ExtendedPrefix + IOServices.GetNonExistentDrive())); + Assert.Contains(IOServices.GetReadyDrives(), drive => Exists(IOInputs.ExtendedPrefix + drive)); } [Fact] diff --git a/src/System.IO.FileSystem/tests/File/Delete.cs b/src/System.IO.FileSystem/tests/File/Delete.cs index 7cd005f944..1dd95f6040 100644 --- a/src/System.IO.FileSystem/tests/File/Delete.cs +++ b/src/System.IO.FileSystem/tests/File/Delete.cs @@ -139,7 +139,7 @@ namespace System.IO.Tests [Trait(XunitConstants.Category, XunitConstants.RequiresElevation)] public void Unix_ExistingDirectory_ReadOnlyVolume() { - if (PlatformDetection.IsRedHatFamily6) + if (PlatformDetection.IsRedHatFamily6 || PlatformDetection.IsAlpine) return; // [ActiveIssue(https://github.com/dotnet/corefx/issues/21920)] ReadOnly_FileSystemHelper(readOnlyDirectory => |