From bf54ae13f6922dad7c8e7c28d55678e9c330382f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 11 Oct 2023 12:07:53 +0200 Subject: [PATCH 1/5] fix: support relative path with drive information in `Path.GetFullPath` (#411) Support relative paths with drive information in `Path.GetFullPath` as described in https://github.com/TestableIO/System.IO.Abstractions/issues/1044. --- .../FileSystem/PathMock.cs | 15 +++++++ .../FileSystem/Path/GetFullPathTests.cs | 43 +++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/Source/Testably.Abstractions.Testing/FileSystem/PathMock.cs b/Source/Testably.Abstractions.Testing/FileSystem/PathMock.cs index f1789cb4c..5d7a7a03e 100644 --- a/Source/Testably.Abstractions.Testing/FileSystem/PathMock.cs +++ b/Source/Testably.Abstractions.Testing/FileSystem/PathMock.cs @@ -37,6 +37,21 @@ public override string GetFullPath(string path) { path.EnsureValidArgument(FileSystem, nameof(path)); + string? pathRoot = Path.GetPathRoot(path); + string? directoryRoot = Path.GetPathRoot(_fileSystem.Storage.CurrentDirectory); + if (!string.IsNullOrEmpty(pathRoot) && !string.IsNullOrEmpty(directoryRoot)) + { + if (char.ToUpperInvariant(pathRoot[0]) != char.ToUpperInvariant(directoryRoot[0])) + { + return Path.GetFullPath(path); + } + + if (pathRoot.Length < directoryRoot.Length) + { + path = path.Substring(pathRoot.Length); + } + } + return Path.GetFullPath(Path.Combine( _fileSystem.Storage.CurrentDirectory, path)); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs index 9b6e8daec..2ffecf0de 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs @@ -5,6 +5,49 @@ public abstract partial class GetFullPathTests : FileSystemTestBase where TFileSystem : IFileSystem { + [SkippableFact] + public void GetFullPath_Dot_ShouldReturnToCurrentDirectory() + { + string expectedFullPath = FileSystem.Directory.GetCurrentDirectory(); + + string result = FileSystem.Path.GetFullPath("."); + + result.Should().Be(expectedFullPath); + } + + [SkippableFact] + public void GetFullPath_RelativePathWithDrive_ShouldReturnExpectedValue() + { + Skip.IfNot(Test.RunsOnWindows); + + string currentDirectory = FileSystem.Directory.GetCurrentDirectory(); + string drive = currentDirectory.Substring(0, 1); + string input = $"{drive}:test.txt"; + string expectedFullPath = FileSystem.Path.Combine(currentDirectory, "test.txt"); + + string result = FileSystem.Path.GetFullPath(input); + + result.Should().Be(expectedFullPath); + } + + [SkippableFact] + public void + GetFullPath_RelativePathWithDrive_WhenCurrentDirectoryIsDifferent_ShouldReturnExpectedValue() + { + Skip.IfNot(Test.RunsOnWindows); + + string currentDirectory = FileSystem.Directory.GetCurrentDirectory(); + string otherDrive = currentDirectory + .Substring(0,1) + .Equals("x", StringComparison.OrdinalIgnoreCase) ? "Y" : "X"; + string input = $"{otherDrive}:test.txt"; + string expectedFullPath = $@"{otherDrive}:\test.txt"; + + string result = FileSystem.Path.GetFullPath(input); + + result.Should().Be(expectedFullPath); + } + [SkippableTheory] [InlineData(@"top/../most/file", @"most/file")] [InlineData(@"top/../most/../dir/file", @"dir/file")] From e61c5dd7cf770fb26825ca3ac66d2b5ca4c414e1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 03:47:05 +0000 Subject: [PATCH 2/5] chore(deps): update xunit-dotnet monorepo (#412) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [xunit](https://togithub.com/xunit/xunit) | `2.5.1` -> `2.5.2` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/xunit/2.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/xunit/2.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/xunit/2.5.1/2.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/xunit/2.5.1/2.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [xunit.runner.visualstudio](https://togithub.com/xunit/visualstudio.xunit) ([source](https://togithub.com/xunit/visualstudio.xunit)) | `2.5.1` -> `2.5.3` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/xunit.runner.visualstudio/2.5.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/xunit.runner.visualstudio/2.5.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/xunit.runner.visualstudio/2.5.1/2.5.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/xunit.runner.visualstudio/2.5.1/2.5.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
xunit/xunit (xunit) ### [`v2.5.2`](https://togithub.com/xunit/xunit/compare/2.5.1...2.5.2) [Compare Source](https://togithub.com/xunit/xunit/compare/2.5.1...2.5.2)
xunit/visualstudio.xunit (xunit.runner.visualstudio) ### [`v2.5.3`](https://togithub.com/xunit/visualstudio.xunit/compare/2.5.1...2.5.3) [Compare Source](https://togithub.com/xunit/visualstudio.xunit/compare/2.5.1...2.5.3)
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/Testably/Testably.Abstractions). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5d40dedab..4c868038b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,8 +28,8 @@ - - + + From b7a2d9dc66d72da0a2a4ca025ec2c4ed8786c2f3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 22:56:53 +0000 Subject: [PATCH 3/5] chore(deps): update dependency xunit to v2.5.3 (#413) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [xunit](https://togithub.com/xunit/xunit) | `2.5.2` -> `2.5.3` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/xunit/2.5.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/xunit/2.5.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/xunit/2.5.2/2.5.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/xunit/2.5.2/2.5.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/Testably/Testably.Abstractions). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4c868038b..1ea20beac 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,7 +28,7 @@ - + From d84221f19fc8a8aa14f8a014c19f0d8f44e23be5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 12:04:15 +0000 Subject: [PATCH 4/5] chore(deps): update actions/checkout digest to b4ffde6 (#414) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://togithub.com/actions/checkout) | action | digest | `8ade135` -> `b4ffde6` | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/Testably/Testably.Abstractions). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 14 +++++++------- .github/workflows/ci-stryker.yml | 2 +- .github/workflows/ci.yml | 10 +++++----- .github/workflows/release.yml | 20 ++++++++++---------- .github/workflows/stryker.yml | 4 ++-- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 363ea0bd2..0287f4e6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: with: distribution: 'temurin' java-version: '17' - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Cache SonarCloud packages @@ -65,7 +65,7 @@ jobs: runs-on: macos-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET @@ -92,7 +92,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET @@ -119,7 +119,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET @@ -146,7 +146,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET @@ -171,7 +171,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET @@ -196,7 +196,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Download code coverage files (MacOS) diff --git a/.github/workflows/ci-stryker.yml b/.github/workflows/ci-stryker.yml index d89780286..5b2fafc02 100644 --- a/.github/workflows/ci-stryker.yml +++ b/.github/workflows/ci-stryker.yml @@ -10,7 +10,7 @@ jobs: timeout-minutes: 300 steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd82bdac4..0d24fa581 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: macos-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET @@ -77,7 +77,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET @@ -110,7 +110,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup MSBuild @@ -135,7 +135,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Save PR number to file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e7e2627c8..989eb77de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: with: distribution: 'temurin' java-version: '17' - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Tag current commit @@ -71,7 +71,7 @@ jobs: runs-on: macos-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Tag current commit @@ -98,7 +98,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Tag current commit @@ -125,7 +125,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Tag current commit @@ -152,7 +152,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Tag current commit @@ -176,7 +176,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Tag current commit @@ -206,7 +206,7 @@ jobs: timeout-minutes: 300 steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET @@ -233,7 +233,7 @@ jobs: timeout-minutes: 300 steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET @@ -275,7 +275,7 @@ jobs: needs: [analyze, test-macos, test-ubuntu, test-windows, test-net-framework, test-examples] steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Tag current commit @@ -340,7 +340,7 @@ jobs: label-template: | state: released - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Delete release branch diff --git a/.github/workflows/stryker.yml b/.github/workflows/stryker.yml index 475d866b9..e92f7a696 100644 --- a/.github/workflows/stryker.yml +++ b/.github/workflows/stryker.yml @@ -12,7 +12,7 @@ jobs: timeout-minutes: 300 steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET @@ -39,7 +39,7 @@ jobs: timeout-minutes: 300 steps: - name: Checkout sources - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - name: Setup .NET From b053078842614a4a89689a70194a8a0e47d8398d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Tue, 24 Oct 2023 10:26:09 +0200 Subject: [PATCH 5/5] fix: `Directory.EnumerateDirectories` with trailing slash in `path` (#415) Reproduce the finding from https://github.com/TestableIO/System.IO.Abstractions/pull/1046 --- .../Storage/InMemoryStorage.cs | 7 ++++++- .../Directory/EnumerateDirectoriesTests.cs | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs b/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs index f85f45beb..12d5e9be5 100644 --- a/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs +++ b/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs @@ -173,6 +173,7 @@ public IEnumerable EnumerateLocations( enumerationOptions ??= EnumerationOptionsHelper.Compatible; string fullPath = location.FullPath; + string fullPathWithoutTrailingSlash = fullPath; #if NETSTANDARD2_0 if (!fullPath.EndsWith($"{_fileSystem.Path.DirectorySeparatorChar}")) #else @@ -181,6 +182,10 @@ public IEnumerable EnumerateLocations( { fullPath += _fileSystem.Path.DirectorySeparatorChar; } + else if (_fileSystem.Path.GetPathRoot(fullPath) != fullPath) + { + fullPathWithoutTrailingSlash = fullPathWithoutTrailingSlash.TrimEnd(_fileSystem.Path.DirectorySeparatorChar); + } foreach (KeyValuePair item in _containers .Where(x => x.Key.FullPath.StartsWith(fullPath, @@ -192,7 +197,7 @@ public IEnumerable EnumerateLocations( item.Key.FullPath.TrimEnd(_fileSystem.Path .DirectorySeparatorChar)); if (!enumerationOptions.RecurseSubdirectories && - parentPath?.Equals(location.FullPath, + parentPath?.Equals(fullPathWithoutTrailingSlash, InMemoryLocation.StringComparisonMode) != true) { continue; diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs index 179f5b011..cd1593bcf 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs @@ -246,4 +246,16 @@ public void result.Count().Should().Be(2); } + + [SkippableFact] + public void EnumerateDirectories_WithTrailingSlash_ShouldEnumerateSubdirectories() + { + string queryPath = @"foo" + FileSystem.Path.DirectorySeparatorChar; + string expectedPath = FileSystem.Path.Combine("foo", "bar"); + FileSystem.Directory.CreateDirectory(expectedPath); + + IEnumerable actualResult = FileSystem.Directory.EnumerateDirectories(queryPath); + + actualResult.Should().BeEquivalentTo(expectedPath); + } }