Move fmt::fprintf to printf.h

This commit is contained in:
Victor Zverovich
2016-08-03 08:52:05 -07:00
parent ed30108918
commit 9dbb60c4c8
7 changed files with 47 additions and 48 deletions
+11
View File
@@ -479,3 +479,14 @@ TEST(PrintfTest, PrintfError) {
TEST(PrintfTest, WideString) {
EXPECT_EQ(L"abc", fmt::sprintf(L"%s", L"abc"));
}
TEST(PrintfTest, PrintfCustom) {
EXPECT_EQ("abc", fmt::sprintf("%s", TestString("abc")));
}
TEST(PrintfTest, OStream) {
std::ostringstream os;
int ret = fmt::fprintf(os, "Don't %s!", "panic");
EXPECT_EQ("Don't panic!", os.str());
EXPECT_EQ(12, ret);
}