windows cli colors revision and test case

This commit is contained in:
Ryuuke
2015-02-08 16:08:29 +00:00
parent bce73e2bd8
commit 5a9dc8f991
3 changed files with 47 additions and 29 deletions

View File

@@ -1371,8 +1371,15 @@ TEST(FormatTest, Print) {
#if FMT_USE_FILE_DESCRIPTORS
TEST(FormatTest, PrintColored) {
#if _WIN32
EXPECT_WRITE(stdout, fmt::print_colored(fmt::RED, "Hello, {}!\n", "world"),
"\x1b[31mHello, world!\n\x1b[0m");
"Hello, world!\n");
EXPECT_WRITE(stdout, fmt::print_colored(static_cast<fmt::Color>(29673),
"Hello, {}!\n", "world"), "Hello, world!\n");
#else
EXPECT_WRITE(stdout, fmt::print_colored(fmt::RED, "Hello, {}!\n", "world"),
"\x1b[31mHello, world!\n\x1b[0m");
#endif
}
#endif