//
// The characters '{' and '}' are reserved and cannot appear anywhere within a
// replacement sequence. Outside of a replacement sequence, in order to print
-// a literal '{' or '}' it must be doubled -- "{{" to print a literal '{' and
-// "}}" to print a literal '}'.
+// a literal '{' it must be doubled as "{{".
//
// ===Parameter Indexing===
+//
// `index` specifies the index of the parameter in the parameter pack to format
// into the output. Note that it is possible to refer to the same parameter
// index multiple times in a given format string. This makes it possible to
ASSERT_EQ(1u, Replacements.size());
EXPECT_EQ("{{{", Replacements[0].Spec);
EXPECT_EQ(ReplacementType::Literal, Replacements[0].Type);
+
+ // } does not require doubling up.
+ Replacements = formatv_object_base::parseFormatString("}");
+ ASSERT_EQ(1u, Replacements.size());
+ EXPECT_EQ("}", Replacements[0].Spec);
+ EXPECT_EQ(ReplacementType::Literal, Replacements[0].Type);
+
+ // } does not require doubling up.
+ Replacements = formatv_object_base::parseFormatString("}}}");
+ ASSERT_EQ(1u, Replacements.size());
+ EXPECT_EQ("}}}", Replacements[0].Spec);
+ EXPECT_EQ(ReplacementType::Literal, Replacements[0].Type);
}
TEST(FormatVariadicTest, ValidReplacementSequence) {