numeric/endian: Add an EndianPacked std::formatter
Change-Id: Ie521dadc74093291d812e725d06fb87679214249
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/numeric/endian.cpp b/test/numeric/endian.cpp
index 8160753..e523565 100644
--- a/test/numeric/endian.cpp
+++ b/test/numeric/endian.cpp
@@ -54,4 +54,12 @@
EXPECT_EQ(0x0f000000, l);
}
+TEST(EndianPacked, Format)
+{
+ EXPECT_EQ(std::format("a {}\n", int32_t{-8456}),
+ std::format("a {}\n", int32_unt{-8456}));
+ EXPECT_EQ(std::format("a {:x}\n", uint32_t{13}),
+ std::format("a {:x}\n", uint32_ult{13}));
+}
+
} // namespace stdplus