diff --git a/Source/Testably.Abstractions.Testing/Helpers/Execute.LinuxPath.cs b/Source/Testably.Abstractions.Testing/Helpers/Execute.LinuxPath.cs index 43b5868b..ae8eb9c2 100644 --- a/Source/Testably.Abstractions.Testing/Helpers/Execute.LinuxPath.cs +++ b/Source/Testably.Abstractions.Testing/Helpers/Execute.LinuxPath.cs @@ -104,11 +104,13 @@ protected override bool IsDirectorySeparator(char c) protected override bool IsEffectivelyEmpty(string path) => string.IsNullOrEmpty(path); +#if FEATURE_PATH_RELATIVE /// /// https://github.com/dotnet/runtime/blob/v8.0.4/src/libraries/Common/src/System/IO/PathInternal.Unix.cs#L77 /// protected override bool IsPartiallyQualified(string path) => !IsPathRooted(path); +#endif /// /// https://github.com/dotnet/runtime/blob/v8.0.4/src/libraries/Common/src/System/IO/PathInternal.Unix.cs#L39 diff --git a/Source/Testably.Abstractions.Testing/Helpers/Execute.SimulatedPath.cs b/Source/Testably.Abstractions.Testing/Helpers/Execute.SimulatedPath.cs index 1d51d114..0a23b059 100644 --- a/Source/Testably.Abstractions.Testing/Helpers/Execute.SimulatedPath.cs +++ b/Source/Testably.Abstractions.Testing/Helpers/Execute.SimulatedPath.cs @@ -550,6 +550,7 @@ string NormalizePath(string path) return sb.ToString(); } +#if FEATURE_PATH_RELATIVE /// /// We have the same root, we need to calculate the difference now using the /// common Length and Segment count past the length. @@ -606,7 +607,9 @@ private string CreateRelativePath(string relativeTo, string path, int commonLeng return sb.ToString(); } +#endif +#if FEATURE_PATH_RELATIVE /// /// Get the common path length from the start of the string. /// @@ -653,12 +656,15 @@ private int GetCommonPathLength(string first, string second, return commonChars; } +#endif protected abstract int GetRootLength(string path); protected abstract bool IsDirectorySeparator(char c); protected abstract bool IsEffectivelyEmpty(string path); +#if FEATURE_PATH_RELATIVE protected abstract bool IsPartiallyQualified(string path); +#endif #if FEATURE_PATH_JOIN || FEATURE_PATH_ADVANCED private string JoinInternal(string?[] paths) diff --git a/Source/Testably.Abstractions.Testing/Helpers/Execute.WindowsPath.cs b/Source/Testably.Abstractions.Testing/Helpers/Execute.WindowsPath.cs index 78c5a4d4..03bcd6ba 100644 --- a/Source/Testably.Abstractions.Testing/Helpers/Execute.WindowsPath.cs +++ b/Source/Testably.Abstractions.Testing/Helpers/Execute.WindowsPath.cs @@ -251,6 +251,7 @@ protected override bool IsEffectivelyEmpty(string path) return path.All(c => c == ' '); } +#if FEATURE_PATH_RELATIVE /// /// https://github.com/dotnet/runtime/blob/v8.0.4/src/libraries/Common/src/System/IO/PathInternal.Windows.cs#L250 /// @@ -279,6 +280,7 @@ protected override bool IsPartiallyQualified(string path) // not qualified if you don't have a valid drive. "=:\" is the "=" file's default data stream. && IsValidDriveChar(path[0])); } +#endif /// /// Returns true if the given character is a valid drive letter