2025-08-22 21:51:32 +08:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
#include <yycc.hpp>
|
|
|
|
|
#include <yycc/windows/console.hpp>
|
|
|
|
|
|
|
|
|
|
#define CONSOLE ::yycc::windows::console
|
|
|
|
|
|
|
|
|
|
namespace yycctest::windows::console {
|
|
|
|
|
#if defined(YYCC_OS_WINDOWS) && defined(YYCC_STL_MSSTL)
|
|
|
|
|
|
|
|
|
|
TEST(WindowsConsole, ColorfulConsole) {
|
|
|
|
|
auto rv = CONSOLE::colorful_console();
|
2026-01-22 16:35:49 +08:00
|
|
|
// Set colorful console should always be success.
|
|
|
|
|
// Unless it is not a TTY.
|
|
|
|
|
EXPECT_TRUE(rv.has_value() || rv.error() == CONSOLE::ExecError::NotTty);
|
2025-08-22 21:51:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
}
|