Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
yaml-cpp
Commits
c67d701a
Commit
c67d701a
authored
Jan 25, 2024
by
Alejandro-FA
Committed by
Jesse Beder
Jan 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix indentation of empty sequences and add test
parent
9eb11429
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
src/emitter.cpp
+1
-0
test/integration/emitter_test.cpp
+11
-0
No files found.
src/emitter.cpp
View file @
c67d701a
...
...
@@ -213,6 +213,7 @@ void Emitter::EmitEndSeq() {
if
(
m_pState
->
CurGroupFlowType
()
==
FlowType
::
Flow
)
{
if
(
m_stream
.
comment
())
m_stream
<<
"
\n
"
;
if
(
originalType
==
FlowType
::
Block
||
m_pState
->
HasBegunNode
())
m_stream
<<
IndentTo
(
m_pState
->
CurIndent
());
if
(
originalType
==
FlowType
::
Block
)
{
m_stream
<<
"["
;
...
...
test/integration/emitter_test.cpp
View file @
c67d701a
...
...
@@ -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
\n
2: []"
);
}
TEST_F
(
EmitterTest
,
EmptyFlowMapWithBegunContent
)
{
out
<<
Flow
;
out
<<
BeginSeq
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment