Fix indentation of empty sequences and add test

This commit is contained in:
Alejandro-FA
2024-01-25 18:19:15 +01:00
committed by Jesse Beder
parent 9eb1142900
commit c67d701ad8
2 changed files with 13 additions and 1 deletions

View File

@@ -176,6 +176,17 @@ TEST_F(EmitterTest, EmptyFlowSeqWithBegunContent) {
]])");
}
TEST_F(EmitterTest, EmptyFlowSeqInMap) {
out << BeginMap;
out << Key << Flow << BeginSeq << EndSeq;
out << Value << 1;
out << Key << 2;
out << Value << Flow << BeginSeq << EndSeq;
out << EndMap;
ExpectEmit("[]: 1\n2: []");
}
TEST_F(EmitterTest, EmptyFlowMapWithBegunContent) {
out << Flow;
out << BeginSeq;