Add test to ensure that no trailing spaces are generated in literals

This commit is contained in:
theamarin 2021-07-03 23:28:36 +02:00
parent dc4c34263d
commit bcc3e35c03

View File

@ -769,5 +769,17 @@ TEST_F(NodeEmitterTest, NestFlowMapListNode) {
ExpectOutput("{position: [1.5, 2.25, 3.125]}", mapNode);
}
TEST_F(NodeEmitterTest, LiteralWithoutTrailingSpaces) {
YAML::Emitter emitter;
emitter << YAML::BeginMap;
emitter << YAML::Key << "key";
emitter << YAML::Literal;
emitter << "value\n\nwith newlines";
emitter << YAML::EndMap;
ASSERT_TRUE(emitter.good());
EXPECT_STREQ("key: |\n value\n\n with newlines", emitter.c_str());
}
}
}