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
| 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.
I suggest using EXPECT_STREQ instead.
There was a problem hiding this comment.
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.
My new code cannot fall into the identity trap anymore.
There was a problem hiding this comment.
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).