approvals / approvals/ApprovalTests.cpp
getDirectorySeparator() returns "\\" on Windows but it sometimes should return "/"
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 339
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
In SystemUtils.cpp there is a function "getDirectorySeparator()". On Windows (when #ifdef _WIN32 returns true) it returns "\".
When you are running under WSL it needs to return "/".
When you are running on a Windows machine under AWS "WorkSpaces Applications" it also needs to return "/".
If you have the wrong directory separator then your tests fail with this message:
Failure:
test case THREW exception:
Unable to create directory:
What it has failed to do is work out the path to put the received file in, since it can't properly parse the directory the test case is in.
I have patched this problem locally where I have seen it just by replacing "\" with "/" in the code. I don't know how to properly determine which directory separator to use on Windows, but it seems that #ifdef _WIN32 is not a good enough guide.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in SystemUtils.cpp by reading getDirectorySeparator() and the surrounding path-handling code. Reproduce the directory-creation failure in WSL or Windows WorkSpaces Applications, then run the affected tests to verify that paths use the appropriate separator and directory creation succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100