Skip to content

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

@ssi-rbarcebal

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

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