Before implementing P2216's format-string adjust the unit tests.
After P2216 the format* functions require a compile-time string literal.
This changes prepares the tests.
Details
- Reviewers
ldionne - Group Reviewers
Restricted Project - Commits
- rG7277b00a29f0: [NFC][libc++][format] Prepare unit tests.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
LGTM with some comments.
libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp | ||
---|---|---|
25 | I would prefer if the tests could include what they use -- here we're using string_literal but we haven't included string_literal.h. I think we should not rely on the transitive include via format_tests.h. | |
libcxx/test/support/string_literal.h | ||
47–50 ↗ | (On Diff #420533) | Should those be private? |
Thanks for the review!
libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp | ||
---|---|---|
25 | In this case the test really requires format_tests.h to be included. But I agree it's good practice not to depend on transitive includes, so I'll fix it. | |
libcxx/test/support/string_literal.h | ||
47–50 ↗ | (On Diff #420533) | No that doesn't compile. I tried that, hence the comment at comment on line 27. I haven't looked at the exact rules of consteval, but I have a strong suspicion the class needs to be an aggregate. |
clang-format suggested style edits found: