Replace EXPECT_STDOUT and EXPECT_STDERR with a single macro EXPECT_WRITE.

This commit is contained in:
Victor Zverovich
2014-05-05 08:35:59 -07:00
parent 098f8ac343
commit 0aacd0cf6d
3 changed files with 48 additions and 29 deletions

View File

@@ -1815,8 +1815,7 @@ TEST(FormatIntTest, FormatDec) {
#ifdef FMT_USE_FILE_DESCRIPTORS
TEST(FormatTest, PrintColored) {
EXPECT_STDOUT(
fmt::PrintColored(fmt::RED, "Hello, {}!\n") << "world",
EXPECT_WRITE(stdout, fmt::PrintColored(fmt::RED, "Hello, {}!\n") << "world",
"\x1b[31mHello, world!\n\x1b[0m");
}