Declare the size of RESET_COLOR.

This is so that the format with a text_tyle will compile even if
header-only mode isn't enabled. Addresses #1063.
This commit is contained in:
Michael Winterberg
2019-03-06 09:41:45 -10:00
committed by Victor Zverovich
parent 8f7780a4f6
commit d8434baa03
2 changed files with 9 additions and 2 deletions
+7
View File
@@ -21,6 +21,7 @@
#endif
#include "fmt/format.h"
#include "fmt/color.h"
#include "gmock.h"
#include "gtest-extra.h"
#include "mock-allocator.h"
@@ -2492,3 +2493,9 @@ TEST(FormatTest, U8StringViewLiteral) {
TEST(FormatTest, FormatU8String) {
EXPECT_EQ(format(fmt::u8string_view("{}"), 42), fmt::u8string_view("42"));
}
TEST(FormatTest, EmphasisNonHeaderOnly) {
// ensure this compiles even if FMT_HEADER_ONLY is not defined.
EXPECT_EQ(fmt::format(fmt::emphasis::bold, "bold error"),
"\x1b[1mbold error\x1b[0m");
}