Implement println (#3267)

This commit is contained in:
Shawn Zhong
2023-01-24 12:30:00 -08:00
committed by GitHub
parent 9409b2e4d8
commit 87c066a35b
6 changed files with 81 additions and 7 deletions
+11 -3
View File
@@ -106,9 +106,17 @@ TEST(ostream_test, empty_custom_output) {
}
TEST(ostream_test, print) {
std::ostringstream os;
fmt::print(os, "Don't {}!", "panic");
EXPECT_EQ("Don't panic!", os.str());
{
std::ostringstream os;
fmt::print(os, "Don't {}!", "panic");
EXPECT_EQ("Don't panic!", os.str());
}
{
std::ostringstream os;
fmt::println(os, "Don't {}!", "panic");
EXPECT_EQ("Don't panic!\n", os.str());
}
}
TEST(ostream_test, write_to_ostream) {