add tests for printf %f precision, fix spacing on %.f precision fix
This commit is contained in:
parent
e787f6b74b
commit
7c62a60fc7
@ -440,7 +440,7 @@ void PrintfFormatter<Char, AF>::format(BasicCStringRef<Char> format_str) {
|
||||
++s;
|
||||
spec.precision_ = internal::PrecisionHandler().visit(get_arg(s));
|
||||
} else {
|
||||
spec.precision_ = 0;
|
||||
spec.precision_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -401,6 +401,9 @@ TEST(PrintfTest, LongLong) {
|
||||
|
||||
TEST(PrintfTest, Float) {
|
||||
EXPECT_PRINTF("392.650000", "%f", 392.65);
|
||||
EXPECT_PRINTF("392.65", "%.2f", 392.65);
|
||||
EXPECT_PRINTF("392.6", "%.1f", 392.65);
|
||||
EXPECT_PRINTF("392", "%.f", 392.65);
|
||||
EXPECT_PRINTF("392.650000", "%F", 392.65);
|
||||
EXPECT_PRINTF("392.65", "%s", 392.65);
|
||||
char buffer[BUFFER_SIZE];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user