From ab3c8efadd87deb14511d82c1862e4ba5d776204 Mon Sep 17 00:00:00 2001 From: Alexey Ochapov Date: Tue, 24 Nov 2020 00:11:11 +0300 Subject: [PATCH] add test with uint64_t and uint32_t numbers --- test/compile-test.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/compile-test.cc b/test/compile-test.cc index 33854868..f14dce8a 100644 --- a/test/compile-test.cc +++ b/test/compile-test.cc @@ -196,6 +196,7 @@ TEST(CompileTimeFormattingTest, OneInteger) { fmt::format_to(buffer.data(), FMT_COMPILE("{}"), 42); }); EXPECT_EQ(result42, "42"); + constexpr auto result420 = constexpr_buffer_helper<3>{}.modify([](auto& buffer) { fmt::format_to(buffer.data(), FMT_COMPILE("{}"), 420); @@ -208,6 +209,14 @@ TEST(CompileTimeFormattingTest, TwoIntegers) { fmt::format_to(buffer.data(), FMT_COMPILE("{} {}"), 41, 43); }); EXPECT_EQ(result, "41 43"); + + constexpr uint64_t value64 = 42; + constexpr uint32_t value32 = 42; + constexpr auto result4202 = + constexpr_buffer_helper<5>{}.modify([value64, value32](auto& buffer) { + fmt::format_to(buffer.data(), FMT_COMPILE("{} {}"), value64, value32); + }); + EXPECT_EQ(result4202, "42 42"); } TEST(CompileTimeFormattingTest, OneString) {