From 8766a1cf1ed6c3b69cef50154139699b72fb52c5 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan <96171496+mkhamoyan@users.noreply.github.com> Date: Fri, 28 Jan 2022 19:02:34 +0400 Subject: [PATCH] #51371 removed CaseInsensitivePlatforms and CaseSensitivePlatforms parameters (#64440) --- .../System.IO.FileSystem/tests/Directory/Exists.cs | 6 ++---- .../tests/Directory/GetFileSystemEntries_str_str.cs | 3 +-- .../System.IO.FileSystem/tests/DirectoryInfo/Exists.cs | 6 ++---- src/libraries/System.IO.FileSystem/tests/File/Create.cs | 3 +-- src/libraries/System.IO.FileSystem/tests/File/Exists.cs | 6 ++---- src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs | 6 ++---- src/libraries/System.IO.FileSystem/tests/FileSystemTest.cs | 3 --- 7 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs index 9e3e21978eb13..983acfc548936 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs @@ -224,8 +224,7 @@ public void WindowsWhiteSpaceAsPath_ReturnsFalse(string component) } - [Fact] - [PlatformSpecific(CaseInsensitivePlatforms)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseInsensitiveOS))] public void DoesCaseInsensitiveInvariantComparisons() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); @@ -234,8 +233,7 @@ public void DoesCaseInsensitiveInvariantComparisons() Assert.True(Exists(testDir.FullName.ToLowerInvariant())); } - [Fact] - [PlatformSpecific(CaseSensitivePlatforms)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseSensitiveOS))] public void DoesCaseSensitiveComparisons() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs b/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs index e439db9369f42..97d8ec20b07ed 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs @@ -718,8 +718,7 @@ public void SearchPatternCaseSensitive() } } - [Fact] - [PlatformSpecific(CaseInsensitivePlatforms)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseInsensitiveOS))] public void SearchPatternCaseInsensitive() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); diff --git a/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs b/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs index 8a007e8df9024..9c076d4ddaead 100644 --- a/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs @@ -67,16 +67,14 @@ public void MissingDirectory(char trailingChar) Assert.False(info.Exists); } - [Fact] - [PlatformSpecific(CaseInsensitivePlatforms)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseInsensitiveOS))] public void CaseInsensitivity() { Assert.True(new DirectoryInfo(TestDirectory.ToUpperInvariant()).Exists); Assert.True(new DirectoryInfo(TestDirectory.ToLowerInvariant()).Exists); } - [Fact] - [PlatformSpecific(CaseSensitivePlatforms)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseSensitiveOS))] public void CaseSensitivity() { Assert.False(new DirectoryInfo(TestDirectory.ToUpperInvariant()).Exists); diff --git a/src/libraries/System.IO.FileSystem/tests/File/Create.cs b/src/libraries/System.IO.FileSystem/tests/File/Create.cs index 69e9042ae1b54..3b1b662a9873b 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/Create.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/Create.cs @@ -233,8 +233,7 @@ public void CaseSensitive() Assert.Throws(() => File.Create(testFile.ToLowerInvariant())); } - [Fact] - [PlatformSpecific(CaseInsensitivePlatforms)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseInsensitiveOS))] public void CaseInsensitive() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); diff --git a/src/libraries/System.IO.FileSystem/tests/File/Exists.cs b/src/libraries/System.IO.FileSystem/tests/File/Exists.cs index 9828ea7524a0e..1fde8ae98ec7d 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/Exists.cs @@ -166,8 +166,7 @@ public void WindowsNonSignificantWhiteSpaceAsPath_ReturnsFalse(string component) } - [Fact] - [PlatformSpecific(CaseInsensitivePlatforms)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseInsensitiveOS))] public void DoesCaseInsensitiveInvariantComparions() { FileInfo testFile = new FileInfo(GetTestFilePath()); @@ -177,8 +176,7 @@ public void DoesCaseInsensitiveInvariantComparions() Assert.True(Exists(testFile.FullName.ToLowerInvariant())); } - [Fact] - [PlatformSpecific(CaseSensitivePlatforms)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseSensitiveOS))] public void DoesCaseSensitiveComparisons() { FileInfo testFile = new FileInfo(GetTestFilePath()); diff --git a/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs b/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs index be6f5e90fdf0d..4435b64befbcc 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs @@ -51,8 +51,7 @@ public void MissingDirectory(char trailingChar) Assert.False(info.Exists); } - [Fact] - [PlatformSpecific(CaseInsensitivePlatforms)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseInsensitiveOS))] public void CaseInsensitivity() { string path = GetTestFilePath(); @@ -61,8 +60,7 @@ public void CaseInsensitivity() Assert.True(new FileInfo(path.ToLowerInvariant()).Exists); } - [Fact] - [PlatformSpecific(CaseSensitivePlatforms)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseSensitiveOS))] public void CaseSensitivity() { string path = GetTestFilePath(); diff --git a/src/libraries/System.IO.FileSystem/tests/FileSystemTest.cs b/src/libraries/System.IO.FileSystem/tests/FileSystemTest.cs index 53251552104f6..3d309194df649 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileSystemTest.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileSystemTest.cs @@ -11,9 +11,6 @@ public abstract partial class FileSystemTest : FileCleanupTestBase { public static readonly byte[] TestBuffer = { 0xBA, 0x5E, 0xBA, 0x11, 0xF0, 0x07, 0xBA, 0x11 }; - protected const TestPlatforms CaseInsensitivePlatforms = TestPlatforms.Windows | TestPlatforms.OSX | TestPlatforms.MacCatalyst; - protected const TestPlatforms CaseSensitivePlatforms = TestPlatforms.AnyUnix & ~TestPlatforms.OSX & ~TestPlatforms.MacCatalyst; - public static bool AreAllLongPathsAvailable => PathFeatures.AreAllLongPathsAvailable(); public static bool LongPathsAreNotBlocked => !PathFeatures.AreLongPathsBlocked();