Move emitter test for trailing spaces in literals to integration test
This commit is contained in:
parent
bcc3e35c03
commit
961e4aede9
@ -382,6 +382,20 @@ TEST_F(EmitterTest, ScalarFormat) {
|
||||
"crazy\tsymbols that we like");
|
||||
}
|
||||
|
||||
TEST_F(EmitterTest, LiteralWithoutTrailingSpaces) {
|
||||
out << YAML::BeginMap;
|
||||
out << YAML::Key << "key";
|
||||
out << YAML::Literal;
|
||||
out << "expect that with two newlines\n\n"
|
||||
"no spaces are emitted in the empty line";
|
||||
out << YAML::EndMap;
|
||||
|
||||
ExpectEmit(
|
||||
"key: |\n"
|
||||
" expect that with two newlines\n\n"
|
||||
" no spaces are emitted in the empty line");
|
||||
}
|
||||
|
||||
TEST_F(EmitterTest, AutoLongKeyScalar) {
|
||||
out << BeginMap;
|
||||
out << Key << Literal << "multi-line\nscalar";
|
||||
|
||||
@ -769,17 +769,5 @@ 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user