// // format_test.cxx // logger_test // // Created by Sam Jaffe on 4/4/19. // #include #include "logger/exception.h" #include "logger/format.h" using namespace logging; TEST(FormatTest, EmptyFormatterCanParse) { EXPECT_NO_THROW(format::parse_format_string("")); } TEST(FormatTest, ThrowsForEndOfStringAfterPct) { EXPECT_THROW(format::parse_format_string("%"), format_parsing_exception); } TEST(FormatTest, RawStringFmtReturnsSelf) { using testing::Eq; auto fmt = format::parse_format_string("TEST STRING"); EXPECT_THAT(fmt.process({}), Eq("TEST STRING")); } TEST(FormatTest, NCharReturnsNewLine) { using testing::Eq; auto fmt = format::parse_format_string("%n"); EXPECT_THAT(fmt.process({}), Eq("\n")); }