Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#51371 removed CaseInsensitivePlatforms and CaseSensitivePlatforms parameters #64440

Merged
merged 1 commit into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/libraries/System.IO.FileSystem/tests/Directory/Exists.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ public void WindowsWhiteSpaceAsPath_ReturnsFalse(string component)

}

[Fact]
[PlatformSpecific(CaseInsensitivePlatforms)]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseInsensitiveOS))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for my education: what is the benefit of doing that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we had 2 ways to check "case sensitivity" having only one will make it it less confusing. And I kept boolean parameter because in some places only bool can be used.

public void DoesCaseInsensitiveInvariantComparisons()
{
DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());
Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,7 @@ public void SearchPatternCaseSensitive()
}
}

[Fact]
[PlatformSpecific(CaseInsensitivePlatforms)]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseInsensitiveOS))]
public void SearchPatternCaseInsensitive()
{
DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/libraries/System.IO.FileSystem/tests/File/Create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ public void CaseSensitive()
Assert.Throws<DirectoryNotFoundException>(() => File.Create(testFile.ToLowerInvariant()));
}

[Fact]
[PlatformSpecific(CaseInsensitivePlatforms)]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseInsensitiveOS))]
public void CaseInsensitive()
{
DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());
Expand Down
6 changes: 2 additions & 4 deletions src/libraries/System.IO.FileSystem/tests/File/Exists.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
6 changes: 2 additions & 4 deletions src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions src/libraries/System.IO.FileSystem/tests/FileSystemTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down