Add some unit tests.

This commit is contained in:
Nicolas Lesser 2018-12-07 19:12:51 +01:00
parent 23db91a091
commit c085401702
No known key found for this signature in database
GPG Key ID: 55F9BC675F85A2DF

View File

@ -228,4 +228,8 @@ TEST(ColorsTest, Colors) {
stdout, stdout,
fmt::print(fg(fmt::color::blue) | fmt::emphasis::bold, "blue/bold"), fmt::print(fg(fmt::color::blue) | fmt::emphasis::bold, "blue/bold"),
"\x1b[1m\x1b[38;2;000;000;255mblue/bold\x1b[0m"); "\x1b[1m\x1b[38;2;000;000;255mblue/bold\x1b[0m");
EXPECT_WRITE(stderr, fmt::print(stderr, fmt::emphasis::bold, "bold error"),
"\x1b[1mbold error\x1b[0m");
EXPECT_WRITE(stderr, fmt::print(stderr, fg(fmt::color::blue), "blue log"),
"\x1b[38;2;000;000;255mblue log\x1b[0m");
} }