Fixed emitter bug with colon at the end of a scalar in a flow collection

This commit is contained in:
Jesse Beder
2011-10-31 19:16:17 -05:00
parent 860365b263
commit 62634f53ec
2 changed files with 8 additions and 1 deletions

View File

@@ -790,6 +790,12 @@ namespace Test
desiredOutput = "apple: \":\"\nbanana: \":\"";
}
void ColonAtEndOfScalarInFlow(YAML::Emitter& out, std::string& desiredOutput)
{
out << YAML::Flow << YAML::BeginMap << YAML::Key << "C:" << YAML::Value << "C:" << YAML::EndMap;
desiredOutput = "{\"C:\": \"C:\"}";
}
void BoolFormatting(YAML::Emitter& out, std::string& desiredOutput)
{
out << YAML::BeginSeq;
@@ -1068,6 +1074,7 @@ namespace Test
RunEmitterTest(&Emitter::EmptyBinary, "empty binary", passed, total);
RunEmitterTest(&Emitter::ColonAtEndOfScalar, "colon at end of scalar", passed, total);
RunEmitterTest(&Emitter::ColonAsScalar, "colon as scalar", passed, total);
RunEmitterTest(&Emitter::ColonAtEndOfScalarInFlow, "colon at end of scalar in flow", passed, total);
RunEmitterTest(&Emitter::BoolFormatting, "bool formatting", passed, total);
RunEmitterTest(&Emitter::DocStartAndEnd, "doc start and end", passed, total);
RunEmitterTest(&Emitter::ImplicitDocStart, "implicit doc start", passed, total);