mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-08 12:21:17 +00:00
fix bug from issue298:Emitter stylings settings overridden by node settings. (#915)
This commit is contained in:
@@ -732,6 +732,31 @@ TEST_F(EmitterTest, GlobalLongKeyOnMap) {
|
||||
: *value)");
|
||||
}
|
||||
|
||||
TEST_F(EmitterTest, GlobalSettingStyleOnSeqNode) {
|
||||
Node n(Load(R"(foo:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
bar: aa)"));
|
||||
out.SetSeqFormat(YAML::Flow);
|
||||
out << n;
|
||||
ExpectEmit(R"(foo: [1, 2, 3]
|
||||
bar: aa)");
|
||||
}
|
||||
|
||||
TEST_F(EmitterTest, GlobalSettingStyleOnMapNode) {
|
||||
Node n(Load(R"(-
|
||||
foo: a
|
||||
bar: b
|
||||
- 2
|
||||
- 3)"));
|
||||
out.SetMapFormat(YAML::Flow);
|
||||
out << n;
|
||||
ExpectEmit(R"(- {foo: a, bar: b}
|
||||
- 2
|
||||
- 3)");
|
||||
}
|
||||
|
||||
TEST_F(EmitterTest, ComplexGlobalSettings) {
|
||||
out << BeginSeq;
|
||||
out << Block;
|
||||
|
Reference in New Issue
Block a user