mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-02 15:11:43 +01:00
Renamed enum color to colors.
Added enum colors conversion to rgb struct. Added colors_test.cpp. Removed print_colored. Renamed enum colors back to color. Removed unnecessary inline keyword. Removed print_rgb.
This commit is contained in:
committed by
Victor Zverovich
parent
0508bbc7ae
commit
ce500635c7
@@ -5,6 +5,7 @@
|
||||
//
|
||||
// For the license information refer to format.h.
|
||||
|
||||
#define FMT_EXTENDED_COLORS
|
||||
#define FMT_NOEXCEPT
|
||||
#undef FMT_SHARED
|
||||
#include "test-assert.h"
|
||||
@@ -116,3 +117,10 @@ TEST(FormatTest, FormatErrorCode) {
|
||||
EXPECT_EQ(msg, to_string(buffer));
|
||||
}
|
||||
}
|
||||
|
||||
TEST(ColorsTest, Colors) {
|
||||
EXPECT_WRITE(stdout, fmt::print(fmt::rgb(255,20,30), "rgb(255,20,30)"),
|
||||
"\x1b[38;2;255;020;030mrgb(255,20,30)\x1b[0m");
|
||||
EXPECT_WRITE(stdout, fmt::print(fmt::color::blue,"blue"),
|
||||
"\x1b[38;2;000;000;255mblue\x1b[0m");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user