Skip to content

MockFileSystem.Path.GetTempPath() returns temp directory with no trailing DirectorySeparatorChar #1171

Closed

Description

@ssi-rbarcebal

Describe the bug
When getting the temp path, the returned directory string does not end with DirectorySeparatorChar.

To Reproduce

var fileSystem = new MockFileSystem();
var tempDir = fileSystem.Path.GetTempPath();

Value of tempDir = "/temp"

Expected behavior
Should be tempDir = "/temp/"

Additional context
Using .NET 8 MacOS. Same issue on Windows but with drive letter.
https://learn.microsoft.com/en-us/dotnet/api/system.io.path.gettemppath?view=net-8.0&tabs=linux

Activity

  1. vbreuss commented on Nov 22, 2024

    @vbreuss
    Member

    Thanks for reporting. I will have a look at it shortly. As a workaround you could also use the MockFileSystem from Testably.Abstractions.

  2. added
    flag: good-first-issueIssues that are good for first time contributors
    and removed on Nov 22, 2024
  3. github-actions commented on Dec 3, 2024

    @github-actions

    This is addressed in release v21.1.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: good-first-issueIssues that are good for first time contributorsstate: releasedIssues that are releasedtype: bugIssues that describe misbehaving functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions