Skip to content

[RFC][libc++][test] Improves testing diagnostics. #88766

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mordante
Copy link
Member

Fixes: #88622

Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
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
View the diff from clang-format here.
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 ***** *****/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the test error reporting
1 participant