[libcxx-commits] [PATCH] D139561: [NFC][libc++][format] Rename tests.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 8 12:36:52 PST 2022


Mordante added a comment.

In D139561#3982491 <https://reviews.llvm.org/D139561#3982491>, @ldionne wrote:

> This is unusual for our test suite. We normally test by function, not by paper, and I think there is value in keeping consistency here. Is there a reason why this fundamentally can't be done (or is much more complicated to do) with the current organization?

I know this is unusual. I hoped the explanation in the commit message was enough to clarify it.
When the Standard adds new formatters, these have a `parse` and `format` member. These can be tested separately, but there should be a test for the interaction. The easiest way to do so is using `std::format` and `std::vformat`. Both are needed since `std::format` tests the `constexpr` validation and `std::vformat` the runtime validation.

The current header with tests is about 3000 lines and the test takes quite a bit of time to execute. Adding a lot more tests for the range-based formatters makes running these tests slower, which is quite annoying during development. The current tests have quite a bit of duplicated testing while not adding a lot of extra test coverage. I can't remove them since all format functions should be tested. For the range-based tests I don't feel they need to do all these extra test. (The extra tests are format_to, formatted_to_n, formatted_size and their 'v' partners.)

Next to the C++23 range-based formatter I expect several new library formatters in C++26.

If you disagree of have other suggestions, maybe discuss it during our next meeting.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139561/new/

https://reviews.llvm.org/D139561



More information about the libcxx-commits mailing list