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

XFile::Append unit test failure #340

Open
DanRStevens opened this issue Nov 21, 2020 · 0 comments
Open

XFile::Append unit test failure #340

DanRStevens opened this issue Nov 21, 2020 · 0 comments

Comments

@DanRStevens
Copy link
Member

Unit tests for XFile::Append are failing on Ubuntu 20.04, with both GCC and Clang:

[ RUN ] XFile.Append
test/XFile.test.cpp:39: Failure
Expected equality of these values:
"a/b/"
XFile::Append("a/", "b/")
Which is: "a/b/."
test/XFile.test.cpp:40: Failure
Expected equality of these values:
"/a/b/"
XFile::Append("/a/", "b/")
Which is: "/a/b/."
test/XFile.test.cpp:42: Failure
Expected equality of these values:
"C:a/b/"
XFile::Append("C:a/", "b/")
Which is: "C:a/b/."
test/XFile.test.cpp:43: Failure
Expected equality of these values:
"C:/a/b/"
XFile::Append("C:/a/", "b/")
Which is: "C:/a/b/."
[ FAILED ] XFile.Append (0 ms)

It seems that paths representing folders are marked with a . for the final component, rather than ending with /. This looks odd and may be unexpected. It's also inconsistent with behaviour on Windows, where paths do end with a /. Perhaps we should look at special casing this to ensure paths representing a folder end with /.

As a potential workaround for unit test failures, we can update the unit tests to use paths with filenames. That will avoid triggering the inconsistent behavior. It's not really a solution though, since it ignores the problem case, leaving it untested. Effectively we can hold off on defining how the problem case should be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant