Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected static string GetNamedPipeServerStreamName()
return Guid.NewGuid().ToString("N");
}

if (!PlatformDetection.IsCaseSensitiveOS)
if (!PlatformDetection.FileCreateCaseSensitive)
{
return $"/tmp/{Guid.NewGuid().ToString("N")}";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ public static partial class PlatformDetection
public static int SlowRuntimeTimeoutModifier = (PlatformDetection.IsDebugRuntime ? 5 : 1);

public static bool IsCaseInsensitiveOS => IsWindows || IsOSX || IsMacCatalyst;
public static bool IsCaseSensitiveOS => !IsCaseInsensitiveOS;

#if NETCOREAPP
public static bool IsCaseSensitiveOS => !IsCaseInsensitiveOS && !RuntimeInformation.RuntimeIdentifier.StartsWith("iossimulator")
&& !RuntimeInformation.RuntimeIdentifier.StartsWith("tvossimulator");
public static bool FileCreateCaseSensitive => IsCaseSensitiveOS && !RuntimeInformation.RuntimeIdentifier.StartsWith("iossimulator")
&& !RuntimeInformation.RuntimeIdentifier.StartsWith("tvossimulator");
#else
public static bool IsCaseSensitiveOS => !IsCaseInsensitiveOS;
public static bool FileCreateCaseSensitive => IsCaseSensitiveOS;
#endif

public static bool IsThreadingSupported => !IsBrowser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void SettingInvalidAttributes_Unix(FileAttributes attributes)
AssertSettingInvalidAttributes(path, attributes);
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseSensitiveOS))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.FileCreateCaseSensitive))]
[InlineData(FileAttributes.Hidden)]
[PlatformSpecific(TestPlatforms.AnyUnix & ~(TestPlatforms.OSX | TestPlatforms.FreeBSD))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ public void WindowsSearchPatternWhitespace()
Assert.Empty(GetEntries(TestDirectory, "\t"));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseSensitiveOS))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.FileCreateCaseSensitive))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/67853", TestPlatforms.tvOS)]
public void SearchPatternCaseSensitive()
{
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.IO.FileSystem/tests/File/Create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public void LongFileName()
Assert.False(File.Exists(path));
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsCaseSensitiveOS))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.FileCreateCaseSensitive))]
public void CaseSensitive()
{
DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,8 @@ public static void GetPermissionSet()
#pragma warning restore SYSLIB0003 // Obsolete: CAS
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.FileCreateCaseSensitive))]
[MemberData(nameof(TestingCreateInstanceFromObjectHandleData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/65560", TestPlatforms.iOS | TestPlatforms.tvOS)]
public static void TestingCreateInstanceFromObjectHandle(string physicalFileName, string assemblyFile, string type, string returnedFullNameType, Type exceptionType)
{
ObjectHandle oh = null;
Expand Down