mirror of
https://github.com/fmtlib/fmt.git
synced 2025-08-03 20:54:44 +02:00
Interpret precision as display width (#4443)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
// For the license information refer to format.h.
|
||||
|
||||
// Check if fmt/format.h compiles with windows.h included before it.
|
||||
#include <gtest/gtest.h>
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
@@ -552,6 +553,10 @@ TEST(format_test, arg_errors) {
|
||||
format_error, "argument not found");
|
||||
}
|
||||
|
||||
TEST(format_test, display_width_precision) {
|
||||
EXPECT_EQ(fmt::format("{:.5}", "🐱🐱🐱"), "🐱🐱");
|
||||
}
|
||||
|
||||
template <int N> struct test_format {
|
||||
template <typename... T>
|
||||
static auto format(fmt::string_view fmt, const T&... args) -> std::string {
|
||||
|
Reference in New Issue
Block a user