| 12345678910111213141516171819202122232425262728293031323334 |
- //
- // format_test.cxx
- // logger_test
- //
- // Created by Sam Jaffe on 4/4/19.
- //
- #include <gmock/gmock.h>
- #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"));
- }
|