Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ssi-rbarcebal opened this issue Nov 21, 2024 · 2 comments · Fixed by #1172
Labels
flag: good-first-issue Issues that are good for first time contributors state: released Issues that are released type: bug Issues that describe misbehaving functionality

Comments

@ssi-rbarcebal
Copy link

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

@vbreuss
Copy link
Member

vbreuss commented Nov 22, 2024

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

@vbreuss vbreuss added flag: good-first-issue Issues that are good for first time contributors and removed state: needs discussion Issues that need further discussion labels Nov 22, 2024
Copy link

github-actions bot commented Dec 3, 2024

This is addressed in release v21.1.7.

@github-actions github-actions bot added the state: released Issues that are released label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: good-first-issue Issues that are good for first time contributors state: released Issues that are released type: bug Issues that describe misbehaving functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants