Get rid of macros

This commit is contained in:
Victor Zverovich
2016-08-27 09:06:21 -07:00
parent 9a07973261
commit 209a1d58bf
4 changed files with 0 additions and 187 deletions
-13
View File
@@ -606,22 +606,9 @@ TEST(FormatterTest, ManyArgs) {
TEST(FormatterTest, NamedArg) {
EXPECT_EQ("1/a/A", format("{_1}/{a_}/{A_}", fmt::arg("a_", 'a'),
fmt::arg("A_", "A"), fmt::arg("_1", 1)));
char a = 'A', b = 'B', c = 'C';
EXPECT_EQ("BB/AA/CC", format("{1}{b}/{0}{a}/{2}{c}", FMT_CAPTURE(a, b, c)));
EXPECT_EQ(" A", format("{a:>2}", FMT_CAPTURE(a)));
EXPECT_THROW_MSG(format("{a+}", FMT_CAPTURE(a)), format_error,
"missing '}' in format string");
EXPECT_THROW_MSG(format("{a}"), format_error, "argument not found");
EXPECT_THROW_MSG(format("{d}", FMT_CAPTURE(a, b, c)), format_error,
"argument not found");
EXPECT_THROW_MSG(format("{a}{}", FMT_CAPTURE(a)),
format_error, "cannot switch from manual to automatic argument indexing");
EXPECT_THROW_MSG(format("{}{a}", FMT_CAPTURE(a)),
format_error, "cannot switch from automatic to manual argument indexing");
EXPECT_EQ(" -42", format("{0:{width}}", -42, fmt::arg("width", 4)));
EXPECT_EQ("st", format("{0:.{precision}}", "str", fmt::arg("precision", 2)));
int n = 100;
EXPECT_EQ(L"n=100", format(L"n={n}", FMT_CAPTURE_W(n)));
}
TEST(FormatterTest, AutoArgIndex) {