From 490265cf22f5c4bff9d4f707de2397687a941ee8 Mon Sep 17 00:00:00 2001 From: Jesse Beder Date: Thu, 8 Nov 2012 18:52:54 -0600 Subject: [PATCH] Added failing tests for emitter ? at the start of a value --- test/emittertests.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/emittertests.cpp b/test/emittertests.cpp index 690de05..de3d14c 100644 --- a/test/emittertests.cpp +++ b/test/emittertests.cpp @@ -946,6 +946,15 @@ namespace Test desiredOutput = "\"Hello\\nWorld\""; } + void QuoteQuestionMark(YAML::Emitter& out, std::string& desiredOutput) + { + out << YAML::BeginMap; + out << "a" << "?foo"; + out << YAML::EndMap; + + desiredOutput = "a: \"?foo\""; + } + //////////////////////////////////////////////////////////////////////////////// // incorrect emitting @@ -1167,6 +1176,7 @@ namespace Test RunEmitterTest(&Emitter::HexAndOct, "hex and oct", passed, total); RunEmitterTest(&Emitter::CompactMapWithNewline, "compact map with newline", passed, total); RunEmitterTest(&Emitter::ForceSingleQuotedToDouble, "force single quoted to double", passed, total); + RunEmitterTest(&Emitter::QuoteQuestionMark, "quote question mark", passed, total); RunEmitterErrorTest(&Emitter::ExtraEndSeq, "extra EndSeq", passed, total); RunEmitterErrorTest(&Emitter::ExtraEndMap, "extra EndMap", passed, total);