From e4758590420565c1a4865913615d0feabae6654c Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 20 Jul 2023 13:47:32 -0700 Subject: [PATCH] Fix overspecified tests --- test/chrono-test.cc | 6 +++--- test/format-test.cc | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/chrono-test.cc b/test/chrono-test.cc index 33c0c2c6..f047c1ea 100644 --- a/test/chrono-test.cc +++ b/test/chrono-test.cc @@ -730,9 +730,9 @@ TEST(chrono_test, special_durations) { "03:33"); EXPECT_EQ(fmt::format("{:%T}", std::chrono::duration{2}), "03:33:20"); - EXPECT_EQ("44.000000000000", - fmt::format("{:%S}", std::chrono::duration( - 1.54213895E+26))); + EXPECT_EQ("01.234", + fmt::format("{:.3%S}", std::chrono::duration( + 1.234e12))); } TEST(chrono_test, unsigned_duration) { diff --git a/test/format-test.cc b/test/format-test.cc index baf33569..52ac2caf 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1427,7 +1427,6 @@ TEST(format_test, prettify_float) { EXPECT_EQ("12.34", fmt::format("{}", 1234e-2)); EXPECT_EQ("0.001234", fmt::format("{}", 1234e-6)); EXPECT_EQ("0.1", fmt::format("{}", 0.1f)); - EXPECT_EQ("0.10000000149011612", fmt::format("{}", double(0.1f))); EXPECT_EQ("1.3563156e-19", fmt::format("{}", 1.35631564e-19f)); }