diff --git a/test/emittertests.cpp b/test/emittertests.cpp index 123b9d1..9920496 100644 --- a/test/emittertests.cpp +++ b/test/emittertests.cpp @@ -938,7 +938,14 @@ namespace Test " intelligence: 56"; } - //////////////////////////////////////////////////////////////////////////////////////////////////////// + void ForceSingleQuotedToDouble(YAML::Emitter& out, std::string& desiredOutput) + { + out << YAML::SingleQuoted << "Hello\nWorld"; + + desiredOutput = "Hello\\nWorld"; + } + + //////////////////////////////////////////////////////////////////////////////// // incorrect emitting void ExtraEndSeq(YAML::Emitter& out, std::string& desiredError) @@ -962,13 +969,6 @@ namespace Test out << YAML::EndMap; } - void BadSingleQuoted(YAML::Emitter& out, std::string& desiredError) - { - desiredError = YAML::ErrorMsg::SINGLE_QUOTED_CHAR; - - out << YAML::SingleQuoted << "Hello\nWorld"; - } - void InvalidAnchor(YAML::Emitter& out, std::string& desiredError) { desiredError = YAML::ErrorMsg::INVALID_ANCHOR; @@ -1135,10 +1135,10 @@ namespace Test RunEmitterTest(&Emitter::DashInBlockContext, "dash in block context", passed, total); 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); RunEmitterErrorTest(&Emitter::ExtraEndSeq, "extra EndSeq", passed, total); RunEmitterErrorTest(&Emitter::ExtraEndMap, "extra EndMap", passed, total); - RunEmitterErrorTest(&Emitter::BadSingleQuoted, "bad single quoted string", passed, total); RunEmitterErrorTest(&Emitter::InvalidAnchor, "invalid anchor", passed, total); RunEmitterErrorTest(&Emitter::InvalidAlias, "invalid alias", passed, total); RunEmitterErrorTest(&Emitter::BadLocalTag, "bad local tag", passed, total);