mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-17 07:50:09 +01:00
Fix handling of implicit conversion to integral types larger than int (#507)
This commit is contained in:
@@ -1234,6 +1234,16 @@ TEST(FormatterTest, FormatIntLocale) {
|
||||
EXPECT_EQ("1--234--567", format("{:n}", 1234567));
|
||||
}
|
||||
|
||||
struct ConvertibleToLongLong {
|
||||
operator fmt::LongLong() const {
|
||||
return fmt::LongLong(1) << 32;
|
||||
}
|
||||
};
|
||||
|
||||
TEST(FormatterTest, FormatConvertibleToLongLong) {
|
||||
EXPECT_EQ("100000000", format("{:x}", ConvertibleToLongLong()));
|
||||
}
|
||||
|
||||
TEST(FormatterTest, FormatFloat) {
|
||||
EXPECT_EQ("392.500000", format("{0:f}", 392.5f));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user