Skip to content

Commit 0b3d4e1

Browse files
committed
Add fixed format tests with precision argument
1 parent 5fbe238 commit 0b3d4e1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test_format.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ void test_fixed()
8181
BOOST_TEST_EQ(std::format("{:f}", T {21, 6, true}), "-21000000.000000");
8282
BOOST_TEST_EQ(std::format("{:f}", T {211, 6, true}), "-211000000.000000");
8383
BOOST_TEST_EQ(std::format("{:f}", T {2111, 6, true}), "-2111000000.000000");
84+
85+
BOOST_TEST_EQ(std::format("{:.0f}", T {21, 6, true}), std::string{"-21000000"});
86+
BOOST_TEST_EQ(std::format("{:.0f}", T {211, 6, true}), std::string{"-211000000"});
87+
BOOST_TEST_EQ(std::format("{:.0f}", T {2111, 6, true}), std::string{"-2111000000"});
8488
}
8589

8690
int main()

0 commit comments

Comments
 (0)