Fix formatting when writing " as a character.

This commit is contained in:
Jesse Beder
2016-01-10 12:08:42 -06:00
parent 97d56c3f36
commit 36fd93a8d5
2 changed files with 12 additions and 2 deletions

View File

@@ -962,6 +962,14 @@ TEST_F(EmitterTest, QuoteNull) {
ExpectEmit("\"null\"");
}
TEST_F(EmitterTest, ValueOfDoubleQuote) {
out << YAML::BeginMap;
out << YAML::Key << "foo" << YAML::Value << '"';
out << YAML::EndMap;
ExpectEmit("foo: \"\\\"\"");
}
class EmitterErrorTest : public ::testing::Test {
protected:
void ExpectEmitError(const std::string& expectedError) {