Use std::filesystem to fix TestFileSys unittests on MSVC - #17395
Closed
Desour wants to merge 6 commits into
Closed
Conversation
* testAbsolutePath: new requirement that doesn't hold (ends with no /) removed * testMakePathRelativeTo: MakePathRelativeTo implemented with std::filesystem
TODOs btw: * check if relative() guarantees that it doesn't end with / * check if weakly_canonical() actually works
…ch is what lexically_relative does) but I saw that lexically_relative can return default constred paths (probably doesn't happen after weakly_canonical, I hope)
Member
Author
Did now. And the trailing / doesn't work anymore. (not sure why, it used to work in previous iterations) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(std::filesystem doesn't consider trailing / for normalization. maybe we should just make all our code robust against this. or implement our own even-more-normal-ize function)
Note: only MakePathRelativeTo, which is new, so this PR is very unlikely to break anything
..if child is not in parent. => it's more generalTo do
This PR is Ready for Review.
How to test
./bin/luanti --run-unittests --test-module TestFileSys