[libcxx-commits] [libcxx] [RFC][libc++][test] Improves testing diagnostics. (PR #88766)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 15 10:55:01 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 4d28d3f93bfee3cecbeb234d1ce306250e12e912 67e2259d12daf44fe699b85b1205eac9a2845fc7 -- libcxx/test/libcxx/time/time.zone/time.zone.timezone/time.zone.members/get_info.sys_time.rule_selection.pass.cpp libcxx/test/support/concat_macros.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/libcxx/time/time.zone/time.zone.timezone/time.zone.members/get_info.sys_time.rule_selection.pass.cpp b/libcxx/test/libcxx/time/time.zone/time.zone.timezone/time.zone.members/get_info.sys_time.rule_selection.pass.cpp
index 5977bfd1f1..9e18172dce 100644
--- a/libcxx/test/libcxx/time/time.zone/time.zone.timezone/time.zone.members/get_info.sys_time.rule_selection.pass.cpp
+++ b/libcxx/test/libcxx/time/time.zone/time.zone.timezone/time.zone.members/get_info.sys_time.rule_selection.pass.cpp
@@ -83,19 +83,23 @@ static const std::chrono::tzdb& parse(std::string_view input) {
   return std::chrono::time_point_cast<std::chrono::seconds>(static_cast<std::chrono::sys_days>(result)) + h + m + s;
 }
 
-static void assert_equal(const std::chrono::sys_info& lhs, const std::chrono::sys_info& rhs, std::source_location loc = std::source_location::current()) {
-  TEST_REQUIRE(lhs.begin == rhs.begin,
-               TEST_WRITE_CONCATENATED(loc,"\nBegin:\nExpected output ", lhs.begin, "\nActual output   ", rhs.begin, '\n'));
+static void assert_equal(const std::chrono::sys_info& lhs,
+                         const std::chrono::sys_info& rhs,
+                         std::source_location loc = std::source_location::current()) {
+  TEST_REQUIRE(
+      lhs.begin == rhs.begin,
+      TEST_WRITE_CONCATENATED(loc, "\nBegin:\nExpected output ", lhs.begin, "\nActual output   ", rhs.begin, '\n'));
   TEST_REQUIRE(lhs.end == rhs.end,
-               TEST_WRITE_CONCATENATED(loc,"\nEnd:\nExpected output ", lhs.end, "\nActual output   ", rhs.end, '\n'));
+               TEST_WRITE_CONCATENATED(loc, "\nEnd:\nExpected output ", lhs.end, "\nActual output   ", rhs.end, '\n'));
   TEST_REQUIRE(
       lhs.offset == rhs.offset,
-      TEST_WRITE_CONCATENATED(loc,"\nOffset:\nExpected output ", lhs.offset, "\nActual output   ", rhs.offset, '\n'));
-  TEST_REQUIRE(lhs.save == rhs.save,
-               TEST_WRITE_CONCATENATED(loc,"\nSave:\nExpected output ", lhs.save, "\nActual output   ", rhs.save, '\n'));
+      TEST_WRITE_CONCATENATED(loc, "\nOffset:\nExpected output ", lhs.offset, "\nActual output   ", rhs.offset, '\n'));
+  TEST_REQUIRE(
+      lhs.save == rhs.save,
+      TEST_WRITE_CONCATENATED(loc, "\nSave:\nExpected output ", lhs.save, "\nActual output   ", rhs.save, '\n'));
   TEST_REQUIRE(
       lhs.abbrev == rhs.abbrev,
-      TEST_WRITE_CONCATENATED(loc,"\nAbbrev:\nExpected output ", lhs.abbrev, "\nActual output   ", rhs.abbrev, '\n'));
+      TEST_WRITE_CONCATENATED(loc, "\nAbbrev:\nExpected output ", lhs.abbrev, "\nActual output   ", rhs.abbrev, '\n'));
 }
 
 /***** ***** TESTS ***** *****/

``````````

</details>


https://github.com/llvm/llvm-project/pull/88766


More information about the libcxx-commits mailing list