Chromium Code Reviews| Index: core/src/fxcrt/fx_basic_bstring_unittest.cpp |
| diff --git a/core/src/fxcrt/fx_basic_bstring_unittest.cpp b/core/src/fxcrt/fx_basic_bstring_unittest.cpp |
| index 3779397891182a8ae30b177e1cc7d66439b748d3..79d88733194c15d08ae39209af602cfc634663e4 100644 |
| --- a/core/src/fxcrt/fx_basic_bstring_unittest.cpp |
| +++ b/core/src/fxcrt/fx_basic_bstring_unittest.cpp |
| @@ -603,3 +603,31 @@ TEST(fxcrt, ByteStringCOperatorNE) { |
| EXPECT_TRUE(c_string2 != byte_string_c); |
| EXPECT_TRUE(c_string3 != byte_string_c); |
| } |
| + |
| +TEST(fxcrt, ByteStringFormatWidth) { |
| + { |
| + CFX_ByteString str; |
|
Tom Sepez
2015/11/03 17:19:49
Do these support the %*d syntax as well? If so, c
dsinclair
2015/11/03 18:50:08
Done.
|
| + str.Format("%5d", 1); |
| + EXPECT_EQ(" 1", str); |
| + } |
| + |
| + { |
| + CFX_ByteString str; |
| + str.Format("%d", 1); |
| + EXPECT_EQ("1", str); |
| + } |
| +} |
| + |
| +TEST(fxcrt, ByteStringFormatPrecision) { |
| + { |
| + CFX_ByteString str; |
| + str.Format("%.2f", 1.12345); |
| + EXPECT_EQ("1.12", str); |
| + } |
| + |
| + { |
| + CFX_ByteString str; |
| + str.Format("%f", 1.12345); |
| + EXPECT_EQ("1.123450", str); |
| + } |
| +} |