-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Re-enable module testing #2332
Re-enable module testing #2332
Conversation
This depends on #2324 |
I've force-pushed my local work-in-progress branch with a lot of additional tests to see if module testing works. It does: https://github.com/DanielaE/fmt/runs/2712421080 |
CI is still failing. |
f5965b3
to
b6b8e68
Compare
Interesting. Never seen this. Is this a GTest feature to compare C-strings by identity rather than by equality? |
test/module-test.cc
Outdated
@@ -405,9 +411,9 @@ TEST(module_test, color) { | |||
|
|||
TEST(module_test, cstring_view) { | |||
fmt::cstring_view nsv("fmt"); | |||
EXPECT_EQ("fmt", nsv.c_str()); | |||
EXPECT_EQ("fmt", std::string_view(nsv.c_str())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using EXPECT_STREQ
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no, this checks the pointer comparison so the correct fix is to move "fmt" into a separate variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My new code cannot fall into the identity trap anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean by identity trap but this must compare pointers, not strings, something like:
auto s = "fmt";
EXPECT_EQ(s, fmt::cstring_view(s).c_str());
b6b8e68
to
cc7b64f
Compare
Prepare for compilation with gcc (modules branch).
cc7b64f
to
4f7ea16
Compare
Thank you! |
Prepare for compilation with gcc (modules branch).