Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
d8bdeb5b
Commit
d8bdeb5b
authored
May 20, 2012
by
Jesse Beder
Browse files
Added failing test for compact map with newline
parent
16fd111a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
test/emittertests.cpp
test/emittertests.cpp
+27
-0
No files found.
test/emittertests.cpp
View file @
d8bdeb5b
...
...
@@ -912,6 +912,32 @@ namespace Test
desiredOutput
=
"[31, 0x1f, 037]"
;
}
void
CompactMapWithNewline
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
{
out
<<
YAML
::
Comment
(
"Characteristics"
);
out
<<
YAML
::
BeginSeq
;
out
<<
YAML
::
BeginMap
;
out
<<
YAML
::
Key
<<
"color"
<<
YAML
::
Value
<<
"blue"
;
out
<<
YAML
::
Key
<<
"height"
<<
YAML
::
Value
<<
120
;
out
<<
YAML
::
EndMap
;
out
<<
YAML
::
Newline
<<
YAML
::
Newline
;
out
<<
YAML
::
Comment
(
"Skills"
);
out
<<
YAML
::
BeginMap
;
out
<<
YAML
::
Key
<<
"attack"
<<
YAML
::
Value
<<
23
;
out
<<
YAML
::
Key
<<
"intelligence"
<<
YAML
::
Value
<<
56
;
out
<<
YAML
::
EndMap
;
out
<<
YAML
::
EndSeq
;
desiredOutput
=
"# Characteristics
\n
"
"- color: blue
\n
"
" height: 120
\n
"
"
\n
"
"# Skills
\n
"
"- attack: 23
\n
"
" intelligence: 56"
;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
// incorrect emitting
...
...
@@ -1145,6 +1171,7 @@ namespace Test
RunEmitterTest
(
&
Emitter
::
SetPrecision
,
"set precision"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
DashInBlockContext
,
"dash in block context"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
HexAndOct
,
"hex and oct"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
CompactMapWithNewline
,
"compact map with newline"
,
passed
,
total
);
RunEmitterErrorTest
(
&
Emitter
::
ExtraEndSeq
,
"extra EndSeq"
,
passed
,
total
);
RunEmitterErrorTest
(
&
Emitter
::
ExtraEndMap
,
"extra EndMap"
,
passed
,
total
);
...
...
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